public void TestSelect() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { using ( TestStaticMesh test = new TestStaticMesh( mockGraphicsDeviceService.GraphicsDevice, 4 ) ) { test.Select(); #if XNA_4 Assert.AreSame( test.VertexBuffer, mockGraphicsDeviceService.GraphicsDevice.GetVertexBuffers()[0].VertexBuffer ); #else Assert.AreSame( test.VertexBuffer, mockGraphicsDeviceService.GraphicsDevice.Vertices[0].VertexBuffer ); #endif } } }
public void TestSimpleConstructor() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { using ( TestStaticMesh test = new TestStaticMesh( mockGraphicsDeviceService.GraphicsDevice, 4 ) ) { } } }
public void TestThrowInConstructorRollback() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { Assert.Throws <ArgumentOutOfRangeException>( delegate() { using ( TestStaticMesh test = new TestStaticMesh( mockGraphicsDeviceService.GraphicsDevice, -1 ) ) { } } ); } }
public void TestFullConstructor() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <TestVertex>(); using ( VertexDeclaration declaration = new VertexDeclaration( mockGraphicsDeviceService.GraphicsDevice, elements ) ) { using ( TestStaticMesh test = new TestStaticMesh( mockGraphicsDeviceService.GraphicsDevice, declaration, 4 ) ) { } } } }