Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 public void Update(Genre genre)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.PutAsJsonAsync(ServerAddress.Address + "genre/", genre).Result;
     }
 }
Ejemplo n.º 3
0
 public void Remove(Genre genre)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.DeleteAsync(ServerAddress.Address + "genre/" + genre.Id).Result;
     }
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 5
0
 public void Genre_getall_returns_multiple_test()
 {
     Genre genreOne = new Genre() { Name = "GenreOne" };
     Genre genreTwo = new Genre() { Name = "GenreTwo" };
 }