public void TestSimpleConstructor() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { using ( TestIndexedStaticMesh test = new TestIndexedStaticMesh( mockGraphicsDeviceService.GraphicsDevice, 4, 4 ) ) { } } }
public void TestThrowInSimpleConstructorRollback() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { Assert.Throws <ArgumentOutOfRangeException>( delegate() { using ( TestIndexedStaticMesh test = new TestIndexedStaticMesh( mockGraphicsDeviceService.GraphicsDevice, 4, -1 ) ) { } } ); } }
public void TestSelect() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { using ( TestIndexedStaticMesh test = new TestIndexedStaticMesh( mockGraphicsDeviceService.GraphicsDevice, 4, 4 ) ) { test.Select(); Assert.AreSame( test.IndexBuffer, mockGraphicsDeviceService.GraphicsDevice.Indices ); } } }
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 ( TestIndexedStaticMesh test = new TestIndexedStaticMesh( mockGraphicsDeviceService.GraphicsDevice, declaration, 4, 4 ) ) { } } } }
public void TestThrowInFullConstructorRollback() { MockedGraphicsDeviceService mockGraphicsDeviceService = new MockedGraphicsDeviceService(); using (IDisposable keeper = mockGraphicsDeviceService.CreateDevice()) { VertexElement[] elements = VertexDeclarationHelper.BuildElementList <TestVertex>(); using ( VertexDeclaration declaration = new VertexDeclaration( mockGraphicsDeviceService.GraphicsDevice, elements ) ) { Assert.Throws <ArgumentOutOfRangeException>( delegate() { using ( TestIndexedStaticMesh test = new TestIndexedStaticMesh( mockGraphicsDeviceService.GraphicsDevice, declaration, 4, -1 ) ) { } } ); } } }