Exemplo n.º 1
0
        public void Calculate_IfBaseTariff_BaseMonthCostCloseToMaxInt_ThrowOverflowException(int baseCost, int consumption)
        {
            var validator = new TariffCalculationSettingsValidator();
            var settings  = new TariffCalculationSettings(baseMonthCost: baseCost);

            _productFactory = new ElectricityProductFactory(validator);
            _product        = _productFactory.Create(settings, TariffType.Base).FirstOrDefault();

            Assert.Throws <OverflowException>(() => _product.Calculate(consumption));
        }
Exemplo n.º 2
0
        public ProductDomainEntityTests()
        {
            var validator = new TariffCalculationSettingsValidator();

            _productFactory = new ElectricityProductFactory(validator);
        }