public void TestGapVertexElements() { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <GapVertex>(); Assert.AreEqual(2, elements.Length); Assert.Greater(elements[1].Offset, elements[0].Offset); }
public void TestThrowOnEmptyVertex() { Assert.Throws <InvalidOperationException>( delegate() { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <EmptyVertex>(); } ); }
public void TestCombine() { VertexElement[] firstElements = VertexDeclarationHelper.BuildElementList <TestVertex>(); VertexElement[] secondElements = VertexDeclarationHelper.BuildElementList < SecondStreamVertex >(); VertexElement[] combinedElements = VertexDeclarationHelper.Combine(firstElements, secondElements); Assert.AreEqual(firstElements.Length + secondElements.Length, combinedElements.Length); CollectionAssert.IsSubsetOf(firstElements, combinedElements); CollectionAssert.IsSubsetOf(secondElements, combinedElements); }
public void TestVertexStreamAssignment() { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <TestVertex>(123); Assert.AreEqual(8, elements.Length); Assert.AreEqual(123, elements[0].Stream); Assert.AreEqual(123, elements[1].Stream); Assert.AreEqual(123, elements[2].Stream); Assert.AreEqual(123, elements[3].Stream); Assert.AreEqual(123, elements[4].Stream); Assert.AreEqual(123, elements[5].Stream); Assert.AreEqual(123, elements[6].Stream); Assert.AreEqual(123, elements[7].Stream); }
public void TestFormatAutoDetection() { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <TestVertex>(); Assert.AreEqual(8, elements.Length); Assert.AreEqual(VertexElementFormat.Vector2, elements[0].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Vector3, elements[1].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Vector4, elements[2].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Color, elements[3].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Single, elements[4].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Short4, elements[5].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Short2, elements[6].VertexElementFormat); Assert.AreEqual(VertexElementFormat.Vector4, elements[7].VertexElementFormat); Assert.AreEqual(1, elements[6].UsageIndex); }