예제 #1
0
        public void ProductCatalog_ShouldThrow_DuplicateProductException_WhenAdding_DuplicateProduct()
        {
            ProductCatalogService ProductCatalogService = new ProductCatalogService();

            ProductCatalogService.AddProduct('A', 30);
            ProductCatalogService.AddProduct('A', 30);
        }
예제 #2
0
        public void ProductCatalog_ShouldReturn_ProductPrice_ByPassingProductName()
        {
            ProductCatalogService ProductCatalogService = new ProductCatalogService();

            ProductCatalogService.AddProduct('A', 30);
            var price = ProductCatalogService.GetPrice('A');

            Assert.AreEqual(price, 30);
        }
예제 #3
0
        public void ProductCatalog_ShouldReturnZero_When_ProductNotFound()
        {
            ProductCatalogService ProductCatalogService = new ProductCatalogService();

            ProductCatalogService.AddProduct('A', 30);
            var price = ProductCatalogService.GetPrice('B');

            Assert.AreEqual(price, 0);
        }