Example #1
0
        public void SutDoesNotEqualSomeOtherObject()
        {
            // Arrange
            var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var dummyOwner  = new object();
            var sut         = new InstanceMethod(dummyMethod, dummyOwner);
            // Act
            var result = sut.Equals(new object());

            // Assert
            Assert.False(result);
        }
Example #2
0
        public void SutEqualsOtherSutWithSameValues()
        {
            // Arrange
            var method = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var owner  = new object();
            var sut    = new InstanceMethod(method, owner);
            var other  = new InstanceMethod(method, owner);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result);
        }
        public void SutDoesNotEqualSomeOtherObject()
        {
            // Fixture setup
            var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var dummyOwner  = new object();
            var sut         = new InstanceMethod(dummyMethod, dummyOwner);
            // Exercise system
            var result = sut.Equals(new object());

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
        public void SutEqualsOtherSutWithSameValues()
        {
            // Fixture setup
            var method = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var owner  = new object();
            var sut    = new InstanceMethod(method, owner);
            var other  = new InstanceMethod(method, owner);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result);
            // Teardown
        }
Example #5
0
        public void SutDoesNotEqualOtherSutWithDifferentOwner()
        {
            // Arrange
            var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var owner1      = new object();
            var sut         = new InstanceMethod(dummyMethod, owner1);

            var owner2 = new object();
            var other  = new InstanceMethod(dummyMethod, owner2);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result);
        }
Example #6
0
        public void SutDoesNotEqualOtherSutWithDifferentMethod()
        {
            // Arrange
            var method1    = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var dummyOwner = new object();
            var sut        = new InstanceMethod(method1, dummyOwner);

            var    method2 = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).Skip(1).First();
            object other   = new InstanceMethod(method2, dummyOwner);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result);
        }
        public void SutDoesNotEqualOtherSutWithDifferentOwner()
        {
            // Fixture setup
            var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var owner1      = new object();
            var sut         = new InstanceMethod(dummyMethod, owner1);

            var owner2 = new object();
            var other  = new InstanceMethod(dummyMethod, owner2);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
        public void SutDoesNotEqualOtherSutWithDifferentMethod()
        {
            // Fixture setup
            var method1    = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var dummyOwner = new object();
            var sut        = new InstanceMethod(method1, dummyOwner);

            var    method2 = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).Skip(1).First();
            object other   = new InstanceMethod(method2, dummyOwner);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
 public void SutEqualsOtherSutWithSameValues()
 {
     // Fixture setup
     var method = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
     var owner = new object();
     var sut = new InstanceMethod(method, owner);
     var other = new InstanceMethod(method, owner);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.True(result);
     // Teardown
 }
        public void SutDoesNotEqualOtherSutWithDifferentOwner()
        {
            // Fixture setup
            var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
            var owner1 = new object();
            var sut = new InstanceMethod(dummyMethod, owner1);

            var owner2 = new object();
            var other = new InstanceMethod(dummyMethod, owner2);
            // Exercise system
            var result = sut.Equals(other);
            // Verify outcome
            Assert.False(result);
            // Teardown
        }
 public void SutDoesNotEqualOtherSutWithDifferentMethod()
 {
     // Fixture setup
     var method1 = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
     var dummyOwner = new object();
     var sut = new InstanceMethod(method1, dummyOwner);
     
     var method2 = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).Skip(1).First();
     object other = new InstanceMethod(method2, dummyOwner);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result);
     // Teardown
 }
 public void SutDoesNotEqualSomeOtherObject()
 {
     // Fixture setup
     var dummyMethod = typeof(object).GetMethods(BindingFlags.Public | BindingFlags.Instance).First();
     var dummyOwner = new object();
     var sut = new InstanceMethod(dummyMethod, dummyOwner);
     // Exercise system
     var result = sut.Equals(new object());
     // Verify outcome
     Assert.False(result);
     // Teardown
 }