public void SutIsRequestSpecification()
 {
     // Fixture setup
     // Exercise system
     var sut = new AndRequestSpecification();
     // Verify outcome
     Assert.IsAssignableFrom<IRequestSpecification>(sut);
     // Teardown
 }
 public void SpecificationsMatchesConstructorSpecifications()
 {
     // Fixture setup
     var expectedSpecifications = new[] { new DelegatingRequestSpecification(), new DelegatingRequestSpecification(), new DelegatingRequestSpecification() };
     var sut = new AndRequestSpecification(expectedSpecifications.Cast<IRequestSpecification>());
     // Exercise system
     IEnumerable<IRequestSpecification> result = sut.Specifications;
     // Verify outcome
     Assert.True(expectedSpecifications.SequenceEqual(result));
     // 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
 }
 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
 }