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

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

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

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

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 10);
        }
Exemplo n.º 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;
 }