diff --git a/UnitTests/ConfiguratorTests.cs b/UnitTests/ConfiguratorTests.cs index 2245f2183bd3e8d3e1ba2ebf9c3b01720fa92062..4c0ae72a39591ec01b54413880853b981f9182d0 100644 --- a/UnitTests/ConfiguratorTests.cs +++ b/UnitTests/ConfiguratorTests.cs @@ -1,20 +1,70 @@ using System; +using Helios.Models; +using Helios.Source; using NUnit.Framework; namespace UnitTests { public class ConfiguratorTests { - [SetUp] - public void Setup() + [Test] + public void GetElevationAngle_SunAngle_ReturnsAngle() + { + Roof roof = new Roof(); + roof.Elevation = 25; + + int elevationAngle = roof.GetElevationAngle(60); + + Assert.AreEqual(85, elevationAngle); + } + + [Test] + public void GetPowerOutput_MockNumbers_ReturnsExpected() + { + SolarPanel panel = new SolarPanel(); + panel.Efficiency = 0.2; + + int solarEnergy = 1000; + int roofArea = 7; + int roofElevation = 85; + + double powerOutput = panel.GetPowerOutput(solarEnergy, roofArea, roofElevation); + + Assert.AreEqual(1394.67, Math.Round(powerOutput, 2)); + } + + [Test] + public void GetInstallationCost_MockArea_ReturnExpected() { + SolarPanel panel = new SolarPanel(); + panel.CostPerMetreSquared = 100; + + int roofArea = 7; + + double installationCost = panel.GetInstallationCost(roofArea); + + Assert.AreEqual(700, installationCost); } [Test] - public void Test1() + public void GetCostPerWatt_MockPanel_ReturnExpected() { - Assert.Pass(); + SolarPanel panel = new SolarPanel(); + panel.Efficiency = 0.2; + panel.CostPerMetreSquared = 100; + + int solarEnergy = 1000; + int roofArea = 7; + int roofElevation = 85; + + panel.GetInstallationCost(7); + panel.GetPowerOutput(solarEnergy, roofArea, roofElevation); + + double costPerWatt = panel.GetCostPerWatt(); + + Assert.AreEqual(0.50, Math.Round(costPerWatt, 2)); } + } }