public void SunApparentLongitudeComparisonTest()
        {
            SolarTimes solarTimes    = TestDirector.SolarTimesInstance(this.TestContext.DataRow);
            decimal    expectedValue = Convert.ToDecimal(this.TestContext.DataRow["SunAppLong"]);
            decimal    actualValue   = solarTimes.SunApparentLongitude;
            decimal    difference    = expectedValue - actualValue;

            CustomAssert.AreEqual(expectedValue, actualValue, TestDirector.SolarDecimalDelta);
        }
        public void EccentricityOfEarthOrbitComparisonTest()
        {
            SolarTimes solarTimes    = TestDirector.SolarTimesInstance(this.TestContext.DataRow);
            decimal    expectedValue = Convert.ToDecimal(this.TestContext.DataRow["EccentEarthOrbit"]);
            decimal    actualValue   = solarTimes.EccentricityOfEarthOrbit;
            decimal    difference    = expectedValue - actualValue;

            CustomAssert.AreEqual(expectedValue, actualValue, TestDirector.SolarDecimalDelta);
        }
        public void SunlightDurationComparisonTest()
        {
            SolarTimes solarTimes    = TestDirector.SolarTimesInstance(this.TestContext.DataRow);
            TimeSpan   expectedValue = TimeSpan.FromMinutes(Convert.ToDouble(this.TestContext.DataRow["SunlightDuration"]));
            TimeSpan   actualValue   = solarTimes.SunlightDuration;
            TimeSpan   difference    = expectedValue - actualValue;

            if (difference > TestDirector.TimeSpanDelta)
            {
                Assert.Fail(string.Format("The Sunlight Duration (Column AA) calculation does not match Excel. The difference is {0}", difference));
            }
        }
        public void SunsetComparisonTest()
        {
            SolarTimes solarTimes    = TestDirector.SolarTimesInstance(this.TestContext.DataRow);
            DateTime   expectedValue = Convert.ToDateTime(this.TestContext.DataRow["SunsetTime"]);
            DateTime   actualValue   = solarTimes.Sunset;
            TimeSpan   difference    = expectedValue.TimeOfDay.Subtract(actualValue.TimeOfDay);

            if (difference > TestDirector.TimeSpanDelta)
            {
                Assert.Fail(string.Format("The Sunset (Column Z) calculation does not match Excel. The difference is {0}", difference));
            }
        }