Exemplo n.º 1
0
        public void CalculatePacksAndCost_AllTest_CorrectResults()
        {
            // Arrange
            var vegScroll = new VegemiteScroll()
            {
                Quantity = 10
            };
            var muffin = new BlueberryMuffin()
            {
                Quantity = 14
            };
            var croissant = new Croissant()
            {
                Quantity = 13
            };

            var items = new List <Item>();

            items.Add(vegScroll);
            items.Add(muffin);
            items.Add(croissant);

            // Act
            var calulatePacksService = new CalulatePacksService();
            var orderSummary         = calulatePacksService.CalculatePacksAndCost(items);

            // Assert
            Assert.AreEqual(98.63, orderSummary.OverallCost);
        }
Exemplo n.º 2
0
        public void CalculatePacksAndCost_VegemiteScrollTest_CheckResults(int quantity, decimal result)
        {
            // Arrange
            var vegScroll = new VegemiteScroll()
            {
                Quantity = quantity
            };
            var items = new List <Item>();

            items.Add(vegScroll);

            // Act
            var calulatePacksService = new CalulatePacksService();
            var orderSummary         = calulatePacksService.CalculatePacksAndCost(items);

            // Assert
            Assert.AreEqual(result, orderSummary.OverallCost);
        }