示例#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);
        }