示例#1
0
        public void TestEqualsWithDifferentObject()
        {
            TestDrawContext testContext1 = new TestDrawContext();
            TestDrawContext testContext2 = new TestDrawContext();

            Assert.IsFalse(testContext1.Equals((object)testContext2));
        }
        public void TestEqualsWithIncpmpatibleDrawContext()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (BasicEffect effect = new BasicEffect(service.GraphicsDevice)) {
                    TestEffectDrawContext test1 = new TestEffectDrawContext(effect);
                    TestDrawContext       test2 = new TestDrawContext();
                    Assert.IsFalse(test1.Equals((object)test2));
                }
            }
        }
示例#3
0
        public void TestEqualsWithIncompatibleObject()
        {
            TestDrawContext testContext = new TestDrawContext();

            Assert.IsFalse(testContext.Equals(123));
        }
示例#4
0
        public void TestGetHashcode()
        {
            TestDrawContext testContext = new TestDrawContext();

            Assert.AreEqual(testContext.GetHashCode(), testContext.GetHashCode());
        }
示例#5
0
        public void TestEqualsWithSameObject()
        {
            TestDrawContext testContext = new TestDrawContext();

            Assert.IsTrue(testContext.Equals((object)testContext));
        }
 public void TestEqualsWithIncompatibleObject() {
   TestDrawContext testContext = new TestDrawContext();
   Assert.IsFalse(testContext.Equals(123));
 }
 public void TestGetHashcode() {
   TestDrawContext testContext = new TestDrawContext();
   Assert.AreEqual(testContext.GetHashCode(), testContext.GetHashCode());
 }
 public void TestEqualsWithDifferentObject() {
   TestDrawContext testContext1 = new TestDrawContext();
   TestDrawContext testContext2 = new TestDrawContext();
   Assert.IsFalse(testContext1.Equals((object)testContext2));
 }
 public void TestEqualsWithSameObject() {
   TestDrawContext testContext = new TestDrawContext();
   Assert.IsTrue(testContext.Equals((object)testContext));
 }
    public void TestEqualsWithIncpmpatibleDrawContext() {
      MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
      using(IDisposable keeper = service.CreateDevice()) {
#if XNA_4
        using(BasicEffect effect = new BasicEffect(service.GraphicsDevice)) {
          TestEffectDrawContext test1 = new TestEffectDrawContext(effect);
          TestDrawContext test2 = new TestDrawContext();
          Assert.IsFalse(test1.Equals((object)test2));
        }
#else
        using(EffectPool pool = new EffectPool()) {
          using(BasicEffect effect = new BasicEffect(service.GraphicsDevice, pool)) {
            TestEffectDrawContext test1 = new TestEffectDrawContext(effect);
            TestDrawContext test2 = new TestDrawContext();
            Assert.IsFalse(test1.Equals((object)test2));
          }
        }
#endif
      }
    }