Beispiel #1
0
        public void ConvertToWaveObjectsArrayTest()
        {
            string[,] array = new string[3, 3] {
                // 0   1   2
                { "a", "", "" },     // 0
                { "", "x", "" },     // 1
                { "", "x", "b" }     // 2
            };

            WaveObject[,] expectedResult = new WaveObject[3, 3]
            {
                { new WaveObject(value: 0, type: ObjectType.StartPoint),            // -- 0,0
                  new WaveObject(value: null, type: ObjectType.None),               // 1,0
                  new WaveObject(value: null, type: ObjectType.None) },             // 2,0
                { new WaveObject(value: null, type: ObjectType.None),               // -- 0,1
                  new WaveObject(value: null, type: ObjectType.Block),              // 1,1
                  new WaveObject(value: null, type: ObjectType.None) },             // 2,1
                { new WaveObject(value: null, type: ObjectType.None),               // -- 0,2
                  new WaveObject(value: null, type: ObjectType.Block),              // 1,2
                  new WaveObject(value: null, type: ObjectType.EndPoint) }          // 2,2
            };

            var result = WaveAlgLee.ConvertToWaveObjectsArray(array);

            for (int j = 0; j < (result.Rank + 1); j++)
            {
                for (int i = 0; i < result.Length / (result.Rank + 1); i++)
                {
                    Assert.AreEqual(expectedResult[i, j], result[i, j]);
                }
            }
        }
Beispiel #2
0
 public void ConvertToWaveObjectsArray_HalfBlankArray()
 {
     string[,] arr = new string[, ] {
         { }
     };
     WaveAlgLee.ConvertToWaveObjectsArray(arr);
 }