コード例 #1
0
        public void GetPowerPriceGoodExpample2()
        {
            PowerPrice_Provider ppp = new PowerPrice_Provider();
            double hourOfTheDay     = _clockProxy2.GetTimeInHours();

            if (hourOfTheDay >= 1.0 && hourOfTheDay < 7.0)
            {
                Assert.AreEqual(ppp.GetPowerPrice(hourOfTheDay), Math.Round(2.372 / 101.94, 3));
            }
            else
            {
                Assert.AreEqual(ppp.GetPowerPrice(hourOfTheDay), Math.Round(7.117 / 101.94, 3));
            }
        }
コード例 #2
0
        public void GetPowerPriceWithDateGoodExample2()
        {
            PowerPrice_Provider ppp = new PowerPrice_Provider();
            double hourOfTheDay     = _clockProxy2.GetTimeInHours();
            int    day = _clockProxy2.GetDay();

            if (hourOfTheDay >= 1.0 && hourOfTheDay < 7.0)
            {
                Assert.AreEqual(ppp.GetPowerPriceWithDate(hourOfTheDay, day), new Tuple <Tuple <int, double>, double>(
                                    new Tuple <int, double>(
                                        day,
                                        hourOfTheDay),
                                    Math.Round(2.372 / 101.94, 3)));
            }
            else
            {
                Assert.AreEqual(ppp.GetPowerPriceWithDate(hourOfTheDay, day), new Tuple <Tuple <int, double>, double>(
                                    new Tuple <int, double>(
                                        day,
                                        hourOfTheDay),
                                    Math.Round(7.117 / 101.94, 3)));
            }
        }