Esempio n. 1
0
        public void WeatherMakerTestSingapore()
        {
            WeatherMaker wm          = new WeatherMaker();
            double       temperature = wm.getCurTemperatureByCityID(1880252);

            Assert.IsTrue(temperature > 15 && temperature < 50 ? true : false);
        }
Esempio n. 2
0
        public void WeatherMakerTest()
        {
            WeatherMaker wm          = new WeatherMaker();
            double       temperature = wm.getCurTemperatureByCityID(1510853);

            Assert.IsTrue(temperature > -40 && temperature < 40 ? true : false);
        }
Esempio n. 3
0
        public void WeatherMakerTestAntarctica()
        {
            WeatherMaker wm          = new WeatherMaker();
            double       temperature = wm.getCurTemperatureByCityID(6255152);

            Assert.IsTrue(temperature > -60 && temperature < -10 ? true : false);
        }
Esempio n. 4
0
        public void TestWeatherJSONParser()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();

            Assert.AreEqual(-900, wm.getCurTemperatureByCityID(012));
        }
Esempio n. 5
0
        public void SayCurrentWeatherInNsk()
        {
            Companion    companion      = new Companion();
            WeatherMaker wm             = new WeatherMaker();
            double       temperatureNsk = wm.getCurTemperatureByCityID(1496747);

            Assert.AreEqual(">>> Сейчас на улице: " + temperatureNsk, companion.getWords("Покажи погоду в Новосибирске"));
        }
Esempio n. 6
0
        public void IsCurrentWeatherCorrect()
        {
            Companion    companion          = new Companion();
            WeatherMaker wm                 = new WeatherMaker();
            double       temperatureBarnaul = wm.getCurTemperatureByCityID(1510853);

            Assert.AreEqual(">>> Сейчас на улице: " + temperatureBarnaul, companion.getWords("Покажи погоду"));
        }
Esempio n. 7
0
        public void GetWeatherFromWrongCityID()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();

            Assert.AreEqual(">>> Скажешь ID города?", companion.getWords("Покажи погоду по ID города"));
            Assert.AreEqual(">>> Упс! Кажется, города с таким ID не существует", companion.getWords("012"));
        }
Esempio n. 8
0
        public void WeatherMakerTestBarnaulNskSydney()
        {
            WeatherMaker wm = new WeatherMaker();
            double       temperatureBarnaul = wm.getCurTemperatureByCityID(1510853);
            double       temperatureNsk     = wm.getCurTemperatureByCityID(1496747);
            double       temperatureSydney  = wm.getCurTemperatureByCityID(2147714);

            Assert.IsTrue((temperatureBarnaul == temperatureNsk) && (temperatureNsk == temperatureSydney) ? false : true);
        }
Esempio n. 9
0
        public void NoNeedToShowWeatherWithoutRequest()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();
            Random       rnd       = new Random();
            int          cityID    = rnd.Next(6553137, 6553171);

            double temperatureRnd = wm.getCurTemperatureByCityID(cityID);

            Assert.AreNotEqual(">>> Сейчас на улице: " + temperatureRnd, companion.getWords(cityID.ToString()));
        }
Esempio n. 10
0
        public void SayCurrentWeatherInRandomCity()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();
            Random       rnd       = new Random();
            int          cityID    = rnd.Next(6553137, 6553171);

            double temperatureRnd = wm.getCurTemperatureByCityID(cityID);

            Assert.AreEqual(">>> Скажешь ID города?", companion.getWords("Покажи погоду по ID города"));
            Assert.AreEqual(">>> Сейчас на улице: " + temperatureRnd, companion.getWords(cityID.ToString()));
        }
Esempio n. 11
0
        public void LetsReturnToDefaultState()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();
            Random       rnd       = new Random();
            int          cityID    = rnd.Next(6553137, 6553171);

            double temperatureRnd = wm.getCurTemperatureByCityID(cityID);

            Assert.AreEqual(">>> Скажешь ID города?", companion.getWords("Покажи погоду по ID города"));
            Assert.AreEqual(">>> Сейчас на улице: " + temperatureRnd, companion.getWords(cityID.ToString()));
            Assert.AreEqual(">>> Пожалуйста!", companion.getWords("Спасибо"));
            Assert.AreEqual(">>> Привет!", companion.getWords("Привет"));
        }