Esempio n. 1
0
        public void IsSatisfiedByTargetReturnsCorrectResult()
        {
            // Arrange
            var target = new object();
            var sut    = new EqualRequestSpecification(target);
            // Act
            var actual = sut.IsSatisfiedBy(target);

            // Assert
            Assert.True(actual);
        }
Esempio n. 2
0
        public void IsSatisfiedByTargetReturnsCorrectResult()
        {
            // Fixture setup
            var target = new object();
            var sut    = new EqualRequestSpecification(target);
            // Exercise system
            var actual = sut.IsSatisfiedBy(target);

            // Verify outcome
            Assert.True(actual);
            // Teardown
        }
Esempio n. 3
0
        public void IsSatisfiedByOtherReturnsCorrectResult()
        {
            // Arrange
            var dummyTarget = new object();
            var sut         = new EqualRequestSpecification(dummyTarget);
            // Act
            var other  = new object();
            var actual = sut.IsSatisfiedBy(other);

            // Assert
            Assert.False(actual);
        }
Esempio n. 4
0
        public void IsSatisfiedByReturnsResultFromComparer(bool expected)
        {
            // Arrange
            var target   = new object();
            var other    = new object();
            var comparer = new DelegatingEqualityComparer
            {
                OnEquals = (x, y) => x == target && y == other && expected
            };
            var sut = new EqualRequestSpecification(target, comparer);
            // Act
            var actual = sut.IsSatisfiedBy(other);

            // Assert
            Assert.Equal(expected, actual);
        }
Esempio n. 5
0
        public void IsSatisfiedByReturnsResultFromComparer(bool expected)
        {
            // Fixture setup
            var target   = new object();
            var other    = new object();
            var comparer = new DelegatingEqualityComparer
            {
                OnEquals = (x, y) => x == target && y == other && expected
            };
            var sut = new EqualRequestSpecification(target, comparer);
            // Exercise system
            var actual = sut.IsSatisfiedBy(other);

            // Verify outcome
            Assert.Equal(expected, actual);
            // Teardown
        }