Пример #1
0
 public void GetWeather_weatherobject_True()
 {
     Domain.DomainEntities.Weather testWeather = new Domain.DomainEntities.Weather();
     testWeather.type          = "testType";
     testWeather.description   = "testDescription";
     testWeather.default_genre = "testGenre";
     Assert.IsTrue(wdb.GetWeather(testWeather).description == "testDescription");
 }
Пример #2
0
 public void Delete_validWeather_Null()
 {
     Domain.DomainEntities.Weather testWeather = new Domain.DomainEntities.Weather();
     testWeather.type          = "testType";
     testWeather.description   = "testDescription";
     testWeather.default_genre = "testGenre";
     wdb.DeleteWeather(wdb.GetWeather(testWeather));
     Assert.IsTrue(wdb.GetWeather(testWeather) == null);
 }
Пример #3
0
 public void Create_validWeather_NotNull()
 {
     Domain.DomainEntities.Weather testWeather = new Domain.DomainEntities.Weather();
     testWeather.type          = "testType";
     testWeather.description   = "testDescription";
     testWeather.default_genre = "testGenre";
     wdb.CreateWeather(testWeather);
     Assert.IsTrue(wdb.GetWeather(testWeather).description == "testDescription");
 }
Пример #4
0
 public void getWeather_weatherId_True()
 {
     Domain.DomainEntities.Weather testWeather = new Domain.DomainEntities.Weather();
     testWeather.type          = "testType";
     testWeather.description   = "testDescription";
     testWeather.default_genre = "testGenre";
     Domain.DomainEntities.Weather realTest = wdb.GetWeather(testWeather);
     Assert.IsTrue(wdb.GetWeather(realTest.weather_id).description == "testDescription");
 }
        public static Weather Map(Domain.DomainEntities.Weather weather)
        {
            if (weather == null)
            {
                return(null);
            }

            Weather w = new Weather()
            {
                Type = weather.type, Description = weather.description, DefaultGenre = weather.default_genre
            };

            return(w);
        }
        public static Domain.DomainEntities.Weather Map(Weather weather)
        {
            if (weather == null)
            {
                return(null);
            }

            Domain.DomainEntities.Weather w = new Domain.DomainEntities.Weather()
            {
                type = weather.Type, description = weather.Description, default_genre = weather.DefaultGenre
            };

            return(w);
        }