public void PrimaryBoilerCalculateEEI_CorrectSolarContribution(PackagedSolutionId id, float expected)
        {
            var package     = new PackageFactory().GetPackage(id);
            var calculation = new BoilerAsPrimary();

            AssignUsageProperties(package);
            var result = new EEICalculationResult();

            result = calculation.CalculateEEI(package);
            var solar = result.SolarHeatContribution;

            //Assert.AreEqual(expected, solar);
            Assert.IsTrue(expected <= solar + 0.1f && expected >= solar - 0.1f);
        }
        public void PrimaryBoilerCalculateEEI_CorrectHeatpumpContribution(PackagedSolutionId id, float expected)
        {
            var package     = new PackageFactory().GetPackage(id);
            var calculation = new BoilerAsPrimary();

            AssignUsageProperties(package);
            var result = new EEICalculationResult();

            result = calculation.CalculateEEI(package);

            float contribution = (float)(result.EffectOfSecondaryHeatPump);

            // Kan ikke få fejl margin på 0.1 endnu
            Assert.IsTrue(expected <= contribution + 0.2f && expected >= contribution - 0.2f);
        }
        public void PrimaryBoilerCalculateEEI_CorrecrOverallResultWContainer(PackagedSolutionId packId, ContainerId id, float expected)
        {
            var package     = new PackageFactory().GetPackage(packId);
            var calculation = new BoilerAsPrimary();

            AssignUsageProperties(package);
            //package.Appliances.Add(new ApplianceFactory().GetBoiler(id) ?? new Appliance());
            if (id == ContainerId.SM500)
            {
                package.ApplianceInstances.Add(new ApplianceInstance()
                {
                    Appliance = new ApplianceFactory().GetContainer(id)
                });
            }
            var result = new EEICalculationResult();

            result = calculation.CalculateEEI(package);
            var EEI = Math.Round(result.EEI);

            Assert.IsTrue(expected <= EEI + 1f && expected >= EEI - 1f);
        }
        public void PrimaryBoilerCalculateEEI_CorrecrOverallResult(PackagedSolutionId packId, BoilerId id, float expected)
        {
            var package     = new PackageFactory().GetPackage(packId);
            var calculation = new BoilerAsPrimary();

            AssignUsageProperties(package);
            //package.Appliances.Add(new ApplianceFactory().GetBoiler(id) ?? new Appliance());
            if (id == BoilerId.LoganoSB150)
            {
                var primary = package.PrimaryHeatingUnitInstance;
                primary.IsPrimary = false;
                package.ApplianceInstances.Add(new ApplianceInstance()
                {
                    Appliance = new ApplianceFactory().GetBoiler(id), IsPrimary = true
                });
            }
            var result = new EEICalculationResult();

            result = calculation.CalculateEEI(package);
            var EEI = Math.Round(result.EEI);

            //Assert.AreEqual(expected, EEI);
            Assert.IsTrue(expected <= EEI + 1f && expected >= EEI - 1f);
        }
示例#5
0
        public void HeatPumpAsPrimStrategyReturnsResultsEEUCalculationResult_true(PackagedSolutionId Id)
        {
            var package = new PackageFactory().GetPackage(Id);

            Assert.AreEqual(HeatPumpStrategy.CalculateEEI(package).GetType(), typeof(EEICalculationResult));
        }