Пример #1
0
        public void TotalPriceDogBath_Receiving_Weekend_Date()
        {
            // Arrange
            var      vaiRex = new VaiRex(15.0m, 50.0m, 1700);
            DateTime date   = DateTime.Parse("28/07/2019");

            // Act
            PetShopResponseViewModel petShopResponse = vaiRex.GetTotalPrice(4, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 355);
        }
Пример #2
0
        public void TotalPriceDogBath_Receiving_Midweek_Date()
        {
            // Arrange
            var      vaiRex = new VaiRex(15.0m, 50.0m, 1700);
            DateTime date   = DateTime.Parse("03/08/2018");

            // Act
            PetShopResponseViewModel petShopResponse = vaiRex.GetTotalPrice(3, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 295);
        }
        public void TotalPriceDogBath_Receiving_Weekend_Date()
        {
            // Arrange
            var      meuCaninoFeliz = new MeuCaninoFeliz(20.0m, 40.0m, 2000);
            DateTime date           = DateTime.Parse("28/07/2019");

            // Act
            PetShopResponseViewModel petShopResponse = meuCaninoFeliz.GetTotalPrice(4, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 336);
        }
        public void TotalPriceDogBath_Receiving_Midweek_Date()
        {
            // Arrange
            var      meuCaninoFeliz = new MeuCaninoFeliz(20.0m, 40.0m, 2000);
            DateTime date           = DateTime.Parse("03/08/2018");

            // Act
            PetShopResponseViewModel petShopResponse = meuCaninoFeliz.GetTotalPrice(3, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 260);
        }
Пример #5
0
        public void TotalPriceDogBath_Receiving_Weekend_Date()
        {
            // Arrange
            var      chowChawGas = new ChowChawGas(30.0m, 45.0m, 800);
            DateTime date        = DateTime.Parse("28/07/2019");

            // Act
            PetShopResponseViewModel petShopResponse = chowChawGas.GetTotalPrice(4, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 345);
        }
Пример #6
0
        public void TotalPriceDogBath_Receiving_Midweek_Date()
        {
            // Arrange
            var      chowChawGas = new ChowChawGas(30.0m, 45.0m, 800);
            DateTime date        = DateTime.Parse("03/08/2018");

            // Act
            PetShopResponseViewModel petShopResponse = chowChawGas.GetTotalPrice(3, 5, date);

            // Assert
            Assert.AreEqual(petShopResponse.TotalPriceDogBath, 315);
        }
Пример #7
0
        public void GetBetterPetShop_VaiRex_Winner()
        {
            // Arrange
            string winnerPetShopName = "Vai Rex";
            var    petShopInput      = new PetShopInputViewModel()
            {
                DateOfBath        = DateTime.Parse("28/07/2019"),
                ErrorMessage      = String.Empty,
                QuantitySmallDogs = 2,
                QuantityBigDogs   = 1
            };

            // Act
            PetShopResponseViewModel petShopResponse = _petShopServices.GetBetterPetShop(petShopInput);

            // Assert
            Assert.AreEqual(petShopResponse.BestPetShopName, winnerPetShopName);
        }
Пример #8
0
        public void GetBetterPetShop_MeuCaninoFeliz_Winner()
        {
            // Arrange
            string winnerPetShopName = "Meu Canino Feliz";
            var    petShopInput      = new PetShopInputViewModel()
            {
                DateOfBath        = DateTime.Parse("03/08/2018"),
                ErrorMessage      = String.Empty,
                QuantitySmallDogs = 3,
                QuantityBigDogs   = 5
            };

            // Act
            PetShopResponseViewModel petShopResponse = _petShopServices.GetBetterPetShop(petShopInput);

            // Assert
            Assert.AreEqual(petShopResponse.BestPetShopName, winnerPetShopName);
        }
Пример #9
0
        public PetShopResponseViewModel GetBetterPetShop(PetShopInputViewModel petShopInput)
        {
            var petShopResponseList = new List <PetShopResponseViewModel>();
            var vaiRex         = new VaiRex(15.0m, 50.0m, 1700);
            var meuCaninoFeliz = new MeuCaninoFeliz(20.0m, 40.0m, 2000);
            var chowChawGas    = new ChowChawGas(30.0m, 45.0m, 800);

            PetShopResponseViewModel totalPriceVaiRexPetShop = vaiRex.GetTotalPrice(petShopInput.QuantitySmallDogs,
                                                                                    petShopInput.QuantityBigDogs,
                                                                                    petShopInput.DateOfBath);
            PetShopResponseViewModel totalPriceMeuCaninoFelizPetShop = meuCaninoFeliz.GetTotalPrice(petShopInput.QuantitySmallDogs,
                                                                                                    petShopInput.QuantityBigDogs,
                                                                                                    petShopInput.DateOfBath);
            PetShopResponseViewModel totalPriceChowChawGasPetShop = chowChawGas.GetTotalPrice(petShopInput.QuantitySmallDogs,
                                                                                              petShopInput.QuantityBigDogs,
                                                                                              petShopInput.DateOfBath);

            petShopResponseList.Add(totalPriceVaiRexPetShop);
            petShopResponseList.Add(totalPriceMeuCaninoFelizPetShop);
            petShopResponseList.Add(totalPriceChowChawGasPetShop);

            return(petShopResponseList.OrderBy(p => p.TotalPriceDogBath).ThenBy(p => p.DogKennelDistanceMetre).FirstOrDefault());
        }