示例#1
0
        public void Genre_add_working_test()
        {
            Genre genre = new Genre() { Name = "test2"};

            Context context = new Context();
            genre = context.Genres.Add(genre);
            context = new Context();
        }
示例#2
0
 public void Update(Genre genre)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.PutAsJsonAsync(ServerAddress.Address + "genre/", genre).Result;
     }
 }
示例#3
0
 public void Remove(Genre genre)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.DeleteAsync(ServerAddress.Address + "genre/" + genre.Id).Result;
     }
 }
示例#4
0
 public List<Movie> GetMovieByGenre(Genre genre)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.GetAsync(ServerAddress.Address + "Moviesbygenre?id=" + genre.Id).Result;
         return response.Content.ReadAsAsync<List<Movie>>().Result;
     }
 }
示例#5
0
 public void Genre_getall_returns_multiple_test()
 {
     Genre genreOne = new Genre() { Name = "GenreOne" };
     Genre genreTwo = new Genre() { Name = "GenreTwo" };
 }