public void CreateRectangleTest() { GraphicsDevice device = MockDrawable.GraphicsDevice; // TODO: Initialize to an appropriate value TextureFactory target = new TextureFactory(device); // TODO: Initialize to an appropriate value int width = 43; // TODO: Initialize to an appropriate value int height = 91; // TODO: Initialize to an appropriate value Texture2D actual = target.CreateRectangle(width, height); Color[] resultingData = new Color[width * height]; actual.GetData<Color>(resultingData); Color[] expected = Enumerable.Repeat(Color.White, width*height).ToArray(); for (int i = 0; i < expected.Length; i++) { Assert.AreEqual(expected[i], resultingData[i]); } }
public void CreateRectangleTest1() { GraphicsDevice device = MockDrawable.GraphicsDevice; TextureFactory target = new TextureFactory(device); int width = 543; int height = 1239; Color color = new Color(134, 234, 65.4f, 100); // TODO: Initialize to an appropriate value Texture2D actual; actual = target.CreateRectangle(width, height, color); Color[] resultingData = new Color[width * height]; actual.GetData<Color>(resultingData); Color[] expectedData = Enumerable.Repeat<Color>(color, width * height).ToArray(); for (int i = 0; i < expectedData.Length; i++) { Assert.AreEqual(expectedData[i], resultingData[i]); } }