public void TestSetAllColors() { uint color = 0xabcdef; VertexData vertexData = new VertexData(4); vertexData.SetColor(color); for (int i = 0; i < vertexData.NumVertices; ++i) { Assert.AreEqual(color, vertexData.ColorAt(i), "wrong color"); } }
public void TestSetAllColorsAndAlphas() { uint color = 0xabcdef; float alpha = 0.5f; VertexData vertexData = new VertexData(4); vertexData.SetColor(color); vertexData.SetAlpha(alpha); for (int i=0; i<vertexData.NumVertices; ++i) { Assert.AreEqual(color, vertexData.ColorAt(i), "wrong color"); AssertAreEqualWithSmallError(alpha, vertexData.AlphaAt(i), "wrong alpha", 0.005f); } }