public void ProduceOfferReturnsCorrectResult( string street, string postalCode, string country, int price, int size) { var sut = new PropertyMortgageApplicationProcessor(); var application = new MortgageApplication { Property = new Property { Address = new Address { Street = street, PostalCode = postalCode, Country = country }, Price = price, Size = size } }; var actual = sut.ProduceOffer(application); var expected = new PropertyProcessor { PriceText = "Asking price" } .ProduceRenderings(application.Property); Assert.Equal(expected, actual); }
public void SutDoesNotEqualAnonymousObject() { var sut = new PropertyProcessor(); var anonymous = new object(); var actual = sut.Equals(anonymous); Assert.False(actual); }
public void SutEqualsOtherReturnsCorrectResult( string priceTextSut, string priceTextOther, bool expected) { var sut = new PropertyProcessor { PriceText = priceTextSut }; var other = new PropertyProcessor { PriceText = priceTextOther }; var actual = sut.Equals(other); Assert.Equal(expected, actual); }
public IEnumerable<IRendering> ProduceOffer(MortgageApplication application) { yield return new TextRendering("Current property will be sold to finance new property."); yield return new LineBreakRendering(); var p = new PropertyProcessor { PriceText = "Estimated sales price" }; foreach (var r in p.ProduceRenderings(application.CurrentProperty)) yield return r; }
public IEnumerable <IRendering> ProduceOffer(MortgageApplication application) { yield return(new TextRendering("Current property will be sold to finance new property.")); yield return(new LineBreakRendering()); var p = new PropertyProcessor { PriceText = "Estimated sales price" }; foreach (var r in p.ProduceRenderings(application.CurrentProperty)) { yield return(r); } }
public void ProduceRenderingsReturnsCorrectResult( string street, string postalCode, string country, int price, int size, string priceText) { var sut = new PropertyProcessor { PriceText = priceText }; var property = new Property { Address = new Address { Street = street, PostalCode = postalCode, Country = country }, Price = price, Size = size }; IEnumerable<IRendering> actual = sut.ProduceRenderings(property); var expected = new IRendering[] { new BoldRendering("Address:"), new TextRendering( " " + street + ", " + postalCode + ", " + country + ". "), new LineBreakRendering(), new BoldRendering(priceText + ":"), new TextRendering(" " + price), new LineBreakRendering(), new BoldRendering("Size:"), new TextRendering(" " + size + " square meters"), new LineBreakRendering() }; Assert.Equal(expected, actual); }