using System.Linq; using System.Utility; using NUnit.Framework; namespace Chernobyl { [TestFixture, Description("Tests for Array type")] public class ArrayTests { [Test] public void As1DReturnsValuesInCorrectOrder() { int[][] columnRows = { new []{ 1, 2, 3 }, // Column [0] new []{ 4, 5, 6 }, // Column [1] new []{ 7, 8, 9 } // Column [2] }; columnRows.As1D().ToArray() .IsEqualTo(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "2D array"); } [Test] public void Select2DReturnsValuesInCorrectOrder() { int[][] columnRows = { new []{ 1, 2, 3 }, new []{ 4, 5, 6 }, new []{ 7, 8, 9 } }; columnRows.Select2D(v => v.ToString()) .IsEqualTo(new[] { new[] { "1", "2", "3" }, new[] { "4", "5", "6" }, new[] { "7", "8", "9" } }, "2D array"); } } }