public void ProduceOfferReturnsCorrectResult( int initialRate, string term) { var application = new MortgageApplication(); var offer = new AdjustableRateAnnuityOffer { InitialRate = initialRate, Term = DateTimeOffset.Parse(term) }; var sut = new AdjustableRateAnnuityOfferMortgageApplicationProcessor { OfferService = new Mock <IOfferService>().Object }; Mock.Get(sut.OfferService) .Setup(o => o.GetAdjustableRateAnnuityOffer(application)) .Returns(offer); var actual = sut.ProduceOffer(application); var expected = new IRendering[] { new Heading2Rendering("Adjustable rate offer"), new BoldRendering("Initial interest rate:"), new TextRendering(" " + offer.InitialRate / 10m + " %"), new LineBreakRendering(), new BoldRendering("Term:"), new TextRendering(" " + offer.Term.ToString("D")), new LineBreakRendering() }; Assert.Equal(expected, actual); }
public void SutDoesNotEqualAnonymousObject() { var sut = new AdjustableRateAnnuityOfferMortgageApplicationProcessor(); var anonymous = new object(); var actual = sut.Equals(anonymous); Assert.False(actual); }
public void SutDoesNotEqualOtherWithDifferentDependencies() { var sut = new AdjustableRateAnnuityOfferMortgageApplicationProcessor { OfferService = new Mock <IOfferService>().Object }; var other = new AdjustableRateAnnuityOfferMortgageApplicationProcessor { OfferService = new Mock <IOfferService>().Object }; var actual = sut.Equals(other); Assert.False(actual); }
public void SutEqualsOtherWithSameDependencies() { var sut = new AdjustableRateAnnuityOfferMortgageApplicationProcessor { OfferService = new Mock <IOfferService>().Object }; var other = new AdjustableRateAnnuityOfferMortgageApplicationProcessor { OfferService = sut.OfferService }; var actual = sut.Equals(other); Assert.True(actual); }
public void SutIsMortgageApplicationProcessor() { var sut = new AdjustableRateAnnuityOfferMortgageApplicationProcessor(); Assert.IsAssignableFrom <IMortgageApplicationProcessor>(sut); }