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

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

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

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

            Assert.AreEqual(service.GetLowestTotal(productsSpecialsQuantities), 10);
        }
예제 #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;
 }