Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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());
        }