public void TestEqualObjects_does_not_throw_exception_when_objects_equal()
        {
            var obj1 = new MethodSignature(typeof(int), typeof(string));
            var obj2 = new MethodSignature(typeof(int), typeof(string));

            EqualityTester.TestEqualObjects(obj1, obj2);
        }
        public void TestEqualObjects_throws_exception_when_objects_not_equal()
        {
            var obj1 = new MethodSignature(typeof(int), typeof(string));
            var obj2 = new MethodSignature(typeof(DateTime), typeof(decimal));

            Assert.Throws <InvalidOperationException>(() => EqualityTester.TestEqualObjects(obj1, obj2));
        }
Beispiel #3
0
        public void Equality_override_works()
        {
            var item1 = new MethodSignature(typeof(int), typeof(string));
            var item2 = new MethodSignature(typeof(int), typeof(string));
            var item3 = new MethodSignature(typeof(DateTime), typeof(decimal));

            EqualityTester.TestEqualObjects(item1, item2);
            EqualityTester.TestUnequalObjects(item2, item3);
            EqualityTester.TestAgainstNull(item3);
        }
 public void TestEqualObjects_throws_exception_if_obj2_null()
 {
     Assert.Throws <ArgumentNullException>(() => EqualityTester.TestEqualObjects(obj1: new TestType(), obj2: null));
 }