public void ShouldReturnNoneForBothPricesIfNoPriceInWebsiteAndDatabase() { // GIVEN var driver = ComponentDriver.Create(); driver.PageDownloaderReturnsNothing(); // WHEN driver.RequestIsSentToMyService(); // THEN driver.ShouldRespondWithText($"[Product {ProductId}] NEW Price: <NONE> OLD Price: <NONE>"); }
public void ShouldReturnNoneForOldPriceIfTheValueIsOnlyOnWebsite() { // GIVEN var driver = ComponentDriver.Create(); var oldPrice = Any.Decimal(); driver.DatabaseHasPrice("40341144", oldPrice); // WHEN driver.RequestIsSentToMyService(); // THEN driver.ShouldRespondWithText($"[Product {ProductId}] NEW Price: <NONE> OLD Price: {oldPrice}"); }
public void ShouldReturnNoneForNewPriceIfTheValueIsOnlyInDatabase() { // GIVEN var driver = ComponentDriver.Create(); var newPrice = Any.Decimal(); driver.PageDownloaderReturnsPageWithPrice(newPrice.ToString("##,#")); // WHEN driver.RequestIsSentToMyService(); // THEN driver.ShouldRespondWithText($"[Product {ProductId}] NEW Price: {newPrice} OLD Price: <NONE>"); }
public void ShouldInformThatNewPriceIsHigherThanOld() { // GIVEN var newPrice = "2000"; var oldPrice = 1900m; var driver = ComponentDriver.Create(); driver.PageDownloaderReturnsPageWithPrice(newPrice); driver.DatabaseHasPrice(ProductId, oldPrice); // WHEN driver.RequestIsSentToMyService(); // THEN driver.ShouldRespondWithText($"[Product {ProductId}] Price now ({newPrice}) is HIGHER than in the past ({oldPrice})"); }