public void IsSatisfiedByPassesRequestToDecoratedSpecification()
        {
            // Arrange
            var expectedRequest = new object();
            var verified        = false;
            var specMock        = new DelegatingRequestSpecification {
                OnIsSatisfiedBy = r => verified = expectedRequest == r
            };
            var sut = new AndRequestSpecification(specMock);

            // Act
            sut.IsSatisfiedBy(expectedRequest);
            // Assert
            Assert.True(verified, "Mock verified");
        }
        public void IsSatisfiedByReturnsCorrectResult(bool expectedResult, IEnumerable <bool> decoratedResults)
        {
            // Arrange
            var decoratedSpecs = from b in decoratedResults
                                 select new DelegatingRequestSpecification {
                OnIsSatisfiedBy = r => b
            };
            var sut = new AndRequestSpecification(decoratedSpecs.Cast <IRequestSpecification>());
            // Act
            var dummyRequest = new object();
            var result       = sut.IsSatisfiedBy(dummyRequest);

            // Assert
            Assert.Equal(expectedResult, result);
        }
        public void IsSatisfiedByPassesRequestToDecoratedSpecification()
        {
            // Fixture setup
            var expectedRequest = new object();
            var verified        = false;
            var specMock        = new DelegatingRequestSpecification {
                OnIsSatisfiedBy = r => verified = expectedRequest == r
            };
            var sut = new AndRequestSpecification(specMock);

            // Exercise system
            sut.IsSatisfiedBy(expectedRequest);
            // Verify outcome
            Assert.True(verified, "Mock verified");
            // Teardown
        }
        public void IsSatisfiedByReturnsCorrectResult(bool expectedResult, IEnumerable <bool> decoratedResults)
        {
            // Fixture setup
            var decoratedSpecs = from b in decoratedResults
                                 select new DelegatingRequestSpecification {
                OnIsSatisfiedBy = r => b
            };
            var sut = new AndRequestSpecification(decoratedSpecs.Cast <IRequestSpecification>());
            // Exercise system
            var dummyRequest = new object();
            var result       = sut.IsSatisfiedBy(dummyRequest);

            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }