예제 #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>");
        }
예제 #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}");
        }
예제 #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>");
        }
예제 #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})");
        }