예제 #1
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        public void TestWeatherJSONParser()
        {
            Companion    companion = new Companion();
            WeatherMaker wm        = new WeatherMaker();

            Assert.AreEqual(-900, wm.getCurTemperatureByCityID(012));
        }
예제 #2
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        public void SayCurrentWeatherInNsk()
        {
            Companion    companion      = new Companion();
            WeatherMaker wm             = new WeatherMaker();
            double       temperatureNsk = wm.getCurTemperatureByCityID(1496747);

            Assert.AreEqual(">>> Сейчас на улице: " + temperatureNsk, companion.getWords("Покажи погоду в Новосибирске"));
        }
예제 #3
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        public void IsCurrentWeatherCorrect()
        {
            Companion    companion          = new Companion();
            WeatherMaker wm                 = new WeatherMaker();
            double       temperatureBarnaul = wm.getCurTemperatureByCityID(1510853);

            Assert.AreEqual(">>> Сейчас на улице: " + temperatureBarnaul, companion.getWords("Покажи погоду"));
        }
예제 #4
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        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()));
        }
예제 #5
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        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()));
        }
예제 #6
0
파일: UnitTest1.cs 프로젝트: betanets/tdd
        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("Привет"));
        }