public ProduceRenderings ( Property property ) : IEnumerable |
||
property | Property | |
Результат | IEnumerable |
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); }