Пример #1
0
        /// <summary>
        /// ”становить сервисы погоды, доступные пользователю
        /// </summary>
        protected void setWeatherServices()
        {
            var opServ = OpenWeatherMap.Get();

            opServ.SetKey("6751ae628280d64a208061753519757f");
            WeatherServicesBus.Get().AddService(1, "Open Weather Map", opServ);

            var yndxServ = YandexWeatherMap.Get();

            yndxServ.SetKey("1149c371-2412-44ae-9b44-33d25dd35216");
            WeatherServicesBus.Get().AddService(2, "Yandex Weather Map", yndxServ);
        }
        public YandexWeatherMapTest()
        {
            _yaService = YandexWeatherMap.Get();

            Mock <ICoordinate> yekatCoord = new Mock <ICoordinate>();

            yekatCoord.Setup(crd => crd.Latitude).Returns(56.8519M);
            yekatCoord.Setup(crd => crd.Longitude).Returns(60.6122M);

            _yekaterinburg = new Mock <ICity>();
            _yekaterinburg.Setup(c => c.Id).Returns(1);
            _yekaterinburg.Setup(c => c.Name).Returns("Yekaterinburg");
            _yekaterinburg.Setup(c => c.Coord).Returns(yekatCoord.Object);
        }