Esempio n. 1
0
        public void ShouldReturnNoneForBothPricesIfNoPriceInWebsiteAndDatabase()
        {
            // GIVEN
            var driver = ComponentDriver.Create();

            driver.PageDownloaderReturnsNothing();

            // WHEN
            driver.RequestIsSentToMyService();

            // THEN
            driver.ShouldRespondWithText($"[Product {ProductId}] NEW Price: <NONE> OLD Price: <NONE>");
        }
Esempio n. 2
0
        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}");
        }
Esempio n. 3
0
        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>");
        }
Esempio n. 4
0
        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})");
        }