Inheritance Hierarchy
DeltaEngine.Graphics.Tests VertexElementTests
Namespace: DeltaEngine.Graphics.Tests
Assembly: DeltaEngine.Graphics.Tests (in DeltaEngine.Graphics.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The VertexElementTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
VertexElementTests | Initializes a new instance of the VertexElementTests class |
Methods
Name | Description | |
---|---|---|
CreationWithInvalidTypeThrows | ||
ElementToString | ||
SaveDataColor | ||
SaveDataPoint | ||
SaveDataVector |
Examples
[Test] public void CreationWithInvalidTypeThrows() { const VertexElementType InvalidType = (VertexElementType)0; Assert.Throws<VertexElement.ElementTypeNotYetSupported>( () => new VertexElement(InvalidType)); }
[Test] public void ElementToString() { var element = new VertexElement(VertexElementType.TextureUV); Assert.AreEqual("TextureUV*2", element.ToString()); }
[Test] public void SaveDataColor() { var element = new VertexElement(VertexElementType.TextureUV); using(var stream = new MemoryStream()) { var writer = new BinaryWriter(stream); element.SaveData(writer, Color.Red); Assert.AreEqual(stream.Length, 4); } }
[Test] public void SaveDataVector() { var element = new VertexElement(VertexElementType.TextureUV); using (var stream = new MemoryStream()) { var writer = new BinaryWriter(stream); element.SaveData(writer, Vector3D.UnitX); Assert.AreEqual(stream.Length, 12); } }
[Test] public void SaveDataPoint() { var element = new VertexElement(VertexElementType.TextureUV); using (var stream = new MemoryStream()) { var writer = new BinaryWriter(stream); element.SaveData(writer, Vector2D.UnitX); Assert.AreEqual(stream.Length, 8); } }
See Also