public void IterateOverIntegerBox() { var iBox = new IntegerBox(new [] { 3, 4, 5, 6 }); // storing results just for demo var result = iBox.IterateOverData(); Assert.That(result, Is.EqualTo("3456")); new GlobalPrinter().PrintData(iBox.GetData()); }
public void DestroyTheInternals() { // Just an illustration... var iBox = new IntegerBox(new[] { 3, 4, 5, 6 }); int[] data = iBox.GetData(); PrintArrayInOrder(data); for (int i = 0; i < data.Length; i++) { if (i == 1) { SomeComplicatedMethodOrProcess(data); // :( } } PrintArrayInOrder(data); }