コード例 #1
0
        public void WindChillFactorTest_WindspeedTooLow()
        {
            WindSpeed   ws = new WindSpeed(2.9, WindSpeed.Unit.MilesPerHour);
            Temperature t  = new Temperature(5, Temperature.Scale.Celsius);

            Assert.ThrowsException <MeteorologyException>(() =>
            {
                WindChillFactor factor = new WindChillFactor(t, ws);
            });
        }
コード例 #2
0
        public void WindChillFactorTest_TemperatureTooHigh()
        {
            WindSpeed   ws = new WindSpeed(10, WindSpeed.Unit.MeterPerSecond);
            Temperature t  = new Temperature(50.1, Temperature.Scale.Fahrenheit);

            Assert.ThrowsException <MeteorologyException>(() =>
            {
                WindChillFactor factor = new WindChillFactor(t, ws);
            });
        }
コード例 #3
0
        public void WindChillFactorTest_WindspeedNotTooLow()
        {
            WindSpeed   ws = new WindSpeed(3, WindSpeed.Unit.MilesPerHour);
            Temperature t  = new Temperature(5, Temperature.Scale.Celsius);

            WindChillFactor factor = new WindChillFactor(t, ws);

            Assert.AreEqual(4.2, Math.Round(factor.WindChillCelsius, 1));
            Assert.AreEqual(39.5, Math.Round(factor.WindChillFahrenheit, 1));
            Assert.AreEqual(673.3, Math.Round(factor.WattsPerMeterSquared, 1));
        }
コード例 #4
0
        public void WindChillFactorTest_TemperatureNotTooHigh()
        {
            WindSpeed   ws = new WindSpeed(10, WindSpeed.Unit.MeterPerSecond);
            Temperature t  = new Temperature(50, Temperature.Scale.Fahrenheit);

            WindChillFactor factor = new WindChillFactor(t, ws);

            Assert.AreEqual(6.2, Math.Round(factor.WindChillCelsius, 1));
            Assert.AreEqual(43.2, Math.Round(factor.WindChillFahrenheit, 1));
            Assert.AreEqual(857.3, Math.Round(factor.WattsPerMeterSquared, 1));
        }
コード例 #5
0
        public void WindChillFactorTest_ValidInput()
        {
            WindSpeed   ws = new WindSpeed(10, WindSpeed.Unit.MeterPerSecond);
            Temperature t  = new Temperature(5, Temperature.Scale.Celsius);

            WindChillFactor factor = new WindChillFactor(t, ws);

            Assert.AreEqual(-0.4, Math.Round(factor.WindChillCelsius, 1));
            Assert.AreEqual(31.3, Math.Round(factor.WindChillFahrenheit, 1));
            Assert.AreEqual(1043.7, Math.Round(factor.WattsPerMeterSquared, 1));
        }