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);
}