コード例 #1
0
 public void TestConstructor() {
   MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
   using(IDisposable keeper = service.CreateDevice()) {
     using(IDisposable context = new BasicEffectDrawContext(service.GraphicsDevice)) {
       Assert.IsNotNull(context);
     }
   }
 }
コード例 #2
0
        public void TestConstructor()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (IDisposable context = new BasicEffectDrawContext(service.GraphicsDevice)) {
                    Assert.IsNotNull(context);
                }
            }
        }
コード例 #3
0
        public void TestEffectRetrieval()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (
                    BasicEffectDrawContext test = new BasicEffectDrawContext(service.GraphicsDevice)
                    ) {
                    Assert.AreSame(test.Effect, test.BasicEffect);
                }
            }
        }
コード例 #4
0
 public void TestEqualsWithDifferentObject() {
   MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
   using(IDisposable keeper = service.CreateDevice()) {
     using(
       BasicEffectDrawContext test1 = new BasicEffectDrawContext(service.GraphicsDevice)
     ) {
       using(
         BasicEffectDrawContext test2 = new BasicEffectDrawContext(service.GraphicsDevice)
       ) {
         Assert.IsTrue(test1.Equals((object)test2));
       }
     }
   }
 }
コード例 #5
0
        public void TestEqualsWithIncompatibleEffect()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (
                    BasicEffectDrawContext test1 = new BasicEffectDrawContext(service.GraphicsDevice)
                    ) {
                    TestEffectDrawContext test2 = new TestEffectDrawContext(null);

                    Assert.IsFalse(test1.Equals((object)test2));
                }
            }
        }
コード例 #6
0
        public void TestDrawWithoutIndices()
        {
            using (Creator creator = new Creator()) {
                TestVertex[] vertices = new TestVertex[9];

                using (
                    BasicEffectDrawContext context = new BasicEffectDrawContext(
                        creator.GraphicsDevice
                        )
                    ) {
                    creator.BatchDrawer.Select(vertices, 9);
                    creator.BatchDrawer.Draw(0, 9, PrimitiveType.TriangleList, context);
                }
            }
        }
コード例 #7
0
        public void TestEqualsWithDifferentObject()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (
                    BasicEffectDrawContext test1 = new BasicEffectDrawContext(service.GraphicsDevice)
                    ) {
                    using (
                        BasicEffectDrawContext test2 = new BasicEffectDrawContext(service.GraphicsDevice)
                        ) {
                        Assert.IsTrue(test1.Equals((object)test2));
                    }
                }
            }
        }
コード例 #8
0
    public void TestDrawWithoutIndices() {
      using(Creator creator = new Creator()) {
        TestVertex[] vertices = new TestVertex[9];

        using(
          BasicEffectDrawContext context = new BasicEffectDrawContext(
            creator.GraphicsDevice
          )
        ) {
          creator.BatchDrawer.Select(vertices, 9);
          creator.BatchDrawer.Draw(0, 9, PrimitiveType.TriangleList, context);
        }
      }
    }
コード例 #9
0
    public void TestEqualsWithIncompatibleEffect() {
      MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
      using(IDisposable keeper = service.CreateDevice()) {
        using(
          BasicEffectDrawContext test1 = new BasicEffectDrawContext(service.GraphicsDevice)
        ) {
          TestEffectDrawContext test2 = new TestEffectDrawContext(null);

          Assert.IsFalse(test1.Equals((object)test2));
        }
      }
    }
コード例 #10
0
 public void TestEffectRetrieval() {
   MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
   using(IDisposable keeper = service.CreateDevice()) {
     using(
       BasicEffectDrawContext test = new BasicEffectDrawContext(service.GraphicsDevice)
     ) {
       Assert.AreSame(test.Effect, test.BasicEffect);
     }
   }
 }