Exemplo n.º 1
0
        public void GetSaleItemByItemNameTest()
        {
            var            repository = new FakeWeeklySaleItemRepository();
            WeeklySaleItem output     = repository.GetSaleItemByName("Item 1");

            Assert.Equal("MTR-123", output.ItemNumber);
        }
Exemplo n.º 2
0
        public void GetSaleItemByIdTest()
        {
            var            repository = new FakeWeeklySaleItemRepository();
            WeeklySaleItem output     = repository.GetSaleItemById(223);

            Assert.Equal("Item 2", output.ItemName);
        }
Exemplo n.º 3
0
        public void GetAllSaleItemTest()
        {
            var repository = new FakeWeeklySaleItemRepository();

            itemsFromRepo = repository.GetAllSaleItems();
            Assert.Equal("Item 1", itemsFromRepo[0].ItemName);
            Assert.Equal("Item 2", itemsFromRepo[1].ItemName);
            Assert.Equal("Item 3", itemsFromRepo[2].ItemName);
        }
Exemplo n.º 4
0
        public void ShowWeeklySalesTest()
        {
            List <WeeklySaleItem> thisWeeksSales = new List <WeeklySaleItem>();
            var repository = new FakeWeeklySaleItemRepository();
            var day        = new DateTime(2018, 05, 31);

            //itemsFromRepo = repository.GetAllSaleItems();


            thisWeeksSales = repository.ShowWeeklySales(day);

            Assert.Equal("Item 1", thisWeeksSales[0].ItemName);
            Assert.Equal("Item 2", thisWeeksSales[1].ItemName);
        }