public void CreateFromRowsTest()
{
Vector4 row0 = new Vector4(1, 2, 3, 4);
Vector4 row1 = new Vector4(5, 6, 7, 8);
Vector4 row2 = new Vector4(9, 10, 11, 12);
Vector4 row3 = new Vector4(13, 14, 15, 16);
Matrix4x4 matrix = Matrix4x4.CreateFromRows(row0, row1, row2, row3);
float[] array = matrix.ToArray();
for (int i = 0; i < 16; i++)
{
Assert.AreEqual(array[i], (float)(i + 1));
}
Assert.AreEqual(row0, matrix.GetRow(0));
Assert.AreEqual(row1, matrix.GetRow(1));
Assert.AreEqual(row2, matrix.GetRow(2));
Assert.AreEqual(row3, matrix.GetRow(3));
Assert.Throws<ArgumentException>(() =>
{
matrix.GetRow(-1);
}
);
Assert.Throws<ArgumentException>(() =>
{
matrix.GetRow(4);
}
);
}