public void TestQuery_ActionGenre_Title_Year_NotFound() { var controller = new MoviesService.Controllers.MoviesController(new TestMoviesServiceContext()); Models.Filter filter = new Models.Filter { Genres = new List <string>() { "Action" }, Title = "Fallout", YearOfRelease = 2008 }; var result = controller.Query(filter); Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public void TestQuery_ActionGenre() { var controller = new MoviesService.Controllers.MoviesController(new TestMoviesServiceContext()); Models.Filter filter = new Models.Filter { Genres = new List <string>() { "Action" } }; var result = controller.Query(filter); Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <List <Models.Movie> >)); var resultMovies = result as OkNegotiatedContentResult <List <Models.Movie> >; Assert.AreEqual(3, resultMovies.Content.Count); }