Exemple #1
0
        public void SpecialNotEnough()
        {
            var productsSpecialsQuantities = GetProductsSpecialsQuantities("productsSpecialsQuantities5.json");
            var service = new TrolleyTotalService();

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 25.3);
        }
Exemple #2
0
        public void UnusedSpecials()
        {
            var productsSpecialsQuantities = GetProductsSpecialsQuantities("productsSpecialsQuantities4.json");
            var service = new TrolleyTotalService();

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 13.8);
        }
Exemple #3
0
        public void CombinationsWithEqualLowest()
        {
            var productsSpecialsQuantities = GetProductsSpecialsQuantities("productsSpecialsQuantities3.json");
            var service = new TrolleyTotalService();

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 8);
        }
Exemple #4
0
        public void UseMultipleSpecials()
        {
            var productsSpecialsQuantities = GetProductsSpecialsQuantities("productsSpecialsQuantities2.json");
            var service = new TrolleyTotalService();

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 10);
        }
Exemple #5
0
 public AnswersController(
     ChallengeConfig challengeConfig,
     ProductSortService productSortService,
     HelperResourceService helperResourceService,
     TrolleyTotalService trolleyTotalService,
     ILogger <AnswersController> logger)
     : base()
 {
     _challengeConfig       = challengeConfig;
     _productSortService    = productSortService;
     _helperResourceService = helperResourceService;
     _trolleyTotalService   = trolleyTotalService;
     _logger = logger;
 }
 public void Initialize()
 {
     _trolleyTotalService = new TrolleyTotalService();
 }
 public TrolleyTotalController(TrolleyTotalService service)
 {
     _service = service;
 }