示例#1
0
        public void CacheInsertTest()
        {
            var productA = new ProductA("test productA", 22, 5);
            var productB = new ProductB("test productB", 30, 4000, 800);

            _sut.InsertProduct(productA);
            _sut.InsertProduct(productB);
            var items = _sut.GetAllProducts();

            Assert.Equal(2, items.Length);
        }
示例#2
0
 //In this step products can be loaded from db
 //buit for this challenge we will hardcode them
 private void ProductSeed(IProductCache cache)
 {
     cache.InsertProduct(new ProductA("basic electricity tariff", 22, 5));
     cache.InsertProduct(new ProductB("Packaged tariff", 30, 4000, 800));
 }