Esempio n. 1
0
            private static IEnumerable <TestCaseData> GetRowTestCases()
            {
                var matrix = RefReadOnlyMatrix4x4.FromSystem2DArray(
                    new float[, ] {
                    { 1, 2, 3, 4 },
                    { 9, 8, 7, 6 },
                    { 3, 6, 12, 24 },
                    { 5, 25, 125, 625 }
                });

                var firstRow = new RefReadOnlyRow <float, RefReadOnlyMatrix4x4>(
                    RefReadOnlyMatrix4x4.FromSystem2DArray(
                        new float[, ] {
                    { 1, 2, 3, 4 },
                    { 0, 0, 0, 0 },
                    { 0, 0, 0, 0 },
                    { 0, 0, 0, 0 }
                }), 0);

                var lastRow = new RefReadOnlyRow <float, RefReadOnlyMatrix4x4>(
                    RefReadOnlyMatrix4x4.FromSystem2DArray(
                        new float[, ] {
                    { 5, 25, 125, 625 },
                    { 0, 0, 0, 0 },
                    { 0, 0, 0, 0 },
                    { 0, 0, 0, 0 }
                }), 0);

                yield return(new TestCaseData(matrix, 0, firstRow));

                yield return(new TestCaseData(matrix, 3, lastRow));
            }
Esempio n. 2
0
 public static void GetRowTest(
     RefReadOnlyMatrix4x4 matrix,
     int index,
     RefReadOnlyRow <float, RefReadOnlyMatrix4x4> expected)
 => CollectionAssert.AreEqual(
     expected, matrix.GetRow <float, RefReadOnlyMatrix4x4>(index));