ProduceOffer() public method

public ProduceOffer ( MortgageApplication application ) : IEnumerable
application Ploeh.Samples.Loan.DataCollection.MortgageApplication
return IEnumerable
        public void ProduceOfferReturnsCorrectResultWhenSpecificationIsSatisfied()
        {
            // Arrange
            var application = new MortgageApplication();

            var sut = new ConditionalMortgageApplicationProcessor
            {
                Specification = new Mock<IMortgageApplicationSpecification>().Object,
                TruthProcessor = new Mock<IMortgageApplicationProcessor>().Object
            };

            Mock.Get(sut.Specification)
                .Setup(s => s.IsSatisfiedBy(application))
                .Returns(true);

            var expected = new []
            {
                new Mock<IRendering>().Object,
                new Mock<IRendering>().Object,
                new Mock<IRendering>().Object,
            };

            Mock.Get(sut.TruthProcessor)
                .Setup(p => p.ProduceOffer(application))
                .Returns(expected);

            // Act
            var actual = sut.ProduceOffer(application);

            // Assert
            Assert.Equal(expected, actual);
        }
        public void ProduceOfferReturnsCorrectResultWhenSpecificationIsNotSatisfied()
        {
            // Arrange
            var application = new MortgageApplication();

            var sut = new ConditionalMortgageApplicationProcessor
            {
                Specification = new Mock<IMortgageApplicationSpecification>().Object,
                TruthProcessor = new Mock<IMortgageApplicationProcessor>().Object
            };

            Mock.Get(sut.Specification)
                .Setup(s => s.IsSatisfiedBy(application))
                .Returns(false);
            Mock.Get(sut.TruthProcessor)
                .Setup(s => s.ProduceOffer(It.IsAny<MortgageApplication>()))
                .Returns(new[] { new Mock<IRendering>().Object });

            // Act
            var actual = sut.ProduceOffer(application);

            // Assert
            Assert.Empty(actual);
        }