Exemplo n.º 1
0
        public void WhenCreatedWithEmptyInputThenEmptyPriceListIsCreated()
        {
            var priceListFactory = new SkuPriceListFactory(new SkuOption[0]);
            var priceList        = priceListFactory.Create();

            Assert.Empty(priceList);
        }
Exemplo n.º 2
0
 public void WhenCreatedWithNullInputThenExceptionIsThrown()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         var priceListFactory = new SkuPriceListFactory(null);
     });
 }
Exemplo n.º 3
0
        public void CreatePriceList(string id, string name, decimal unitPrice)
        {
            var priceListFactory = new SkuPriceListFactory(new[]
            {
                new SkuOption()
                {
                    Id = id, Name = name, UnitPrice = unitPrice
                }
            });
            var priceList = priceListFactory.Create();

            Assert.NotEmpty(priceList);
            Assert.Equal(1, priceList.Count);

            Assert.Equal(1, priceList.Keys.Count(sku => sku.Id == id));
            Assert.Equal(unitPrice, priceList.First(pair => pair.Key.Id == id).Value);
        }