public void SutEqualsOtherObjectWithSameMethod()
        {
            var    method = ((Action <object>) delegate { }).GetMethodInfo();
            var    sut    = new StaticMethod(method);
            object other  = new StaticMethod(method);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result);
        }
        public void SutDoesNotEqualSomeOtherObject()
        {
            // Arrange
            var method = ((Action <object>) delegate { }).GetMethodInfo();
            var sut    = new StaticMethod(method);
            // Act
            var result = sut.Equals(new object());

            // Assert
            Assert.False(result);
        }
Example #3
0
        public void SutEqualsOtherObjectWithSameMethod()
        {
            Action <object> action = o => { };
            var             method = action.GetMethodInfo();
            var             sut    = new StaticMethod(method);
            object          other  = new StaticMethod(method);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result);
        }
Example #4
0
        public void SutDoesNotEqualSomeOtherObject()
        {
            // Arrange
            Action <object> action = o => { };
            var             method = action.GetMethodInfo();
            var             sut    = new StaticMethod(method);
            // Act
            var result = sut.Equals(new object());

            // Assert
            Assert.False(result);
        }
Example #5
0
        public void SutEqualsOtherObjectWithSameMethod()
        {
            var    method = ((Action <object>) delegate { }).GetMethodInfo();
            var    sut    = new StaticMethod(method);
            object other  = new StaticMethod(method);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result);
            // Teardown
        }
Example #6
0
        public void SutDoesNotEqualSomeOtherObject()
        {
            // Fixture setup
            var method = ((Action <object>) delegate { }).GetMethodInfo();
            var sut    = new StaticMethod(method);
            // Exercise system
            var result = sut.Equals(new object());

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Example #7
0
        public void SutDoesNotEqualNullSut()
        {
            // Fixture setup
            var method = ((Action <object>) delegate { }).Method;
            var sut    = new StaticMethod(method);
            // Exercise system
            var result = sut.Equals((StaticMethod)null);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Example #8
0
        public void SutEqualsOtherObjectWithSameMethodAndSameParameters()
        {
            var    method     = ((Action <object>) delegate { }).Method;
            var    parameters = method.GetParameters();
            var    sut        = new StaticMethod(method, parameters);
            object other      = new StaticMethod(method, parameters);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result);
            // Teardown
        }
        public void SutDoesNotEqualOtherObjectWithDifferentParameters()
        {
            // Arrange
            var method = ((Action <object>) delegate { }).GetMethodInfo();
            var sut    = new StaticMethod(method, method.GetParameters());

            var    otherParameters = ((Action <int>) delegate { }).GetMethodInfo().GetParameters();
            object other           = new StaticMethod(method, otherParameters);

            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result);
        }
Example #10
0
        public void SutDoesNotEqualOtherObjectWithDifferentParameters()
        {
            // Fixture setup
            var method = ((Action <object>) delegate { }).GetMethodInfo();
            var sut    = new StaticMethod(method, method.GetParameters());

            var    otherParameters = ((Action <int>) delegate { }).GetMethodInfo().GetParameters();
            object other           = new StaticMethod(method, otherParameters);

            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Example #11
0
        public void SutDoesNotEqualOtherObjectWithDifferentMethod()
        {
            // Fixture setup
            var method = ((Action <object>) delegate { }).Method;
            var sut    = new StaticMethod(method);

            var    otherMethod = ((Action <int>) delegate { }).Method;
            object other       = new StaticMethod(otherMethod);

            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Example #12
0
        public void SutDoesNotEqualOtherObjectWithDifferentParameters()
        {
            // Arrange
            Action <object> action = o => { };
            var             method = action.GetMethodInfo();
            var             sut    = new StaticMethod(method, method.GetParameters());

            Action <int> otherAction     = i => { };
            var          otherParameters = otherAction.GetMethodInfo().GetParameters();
            object       other           = new StaticMethod(method, otherParameters);

            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result);
        }
Example #13
0
 public void SutEqualsOtherObjectWithSameMethodAndSameParameters()
 {
     var method = ((Action<object>)delegate { }).Method;
     var parameters = method.GetParameters();
     var sut = new StaticMethod(method, parameters);
     object other = new StaticMethod(method, parameters);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.True(result);
     // Teardown
 }
Example #14
0
        public void SutDoesNotEqualOtherObjectWithDifferentParameters()
        {
            // Fixture setup
            var method = ((Action<object>)delegate { }).Method;
            var sut = new StaticMethod(method, method.GetParameters());

            var otherParameters = ((Action<int>)delegate { }).Method.GetParameters();
            object other = new StaticMethod(method, otherParameters);

            // Exercise system
            var result = sut.Equals(other);
            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Example #15
0
 public void SutDoesNotEqualSomeOtherObject()
 {
     // Fixture setup
     var method = ((Action<object>)delegate { }).Method;
     var sut = new StaticMethod(method);
     // Exercise system
     var result = sut.Equals(new object());
     // Verify outcome
     Assert.False(result);
     // Teardown
 }