public void GetRolesForActor() { var listOfMovies = new List <Movie> { new Movie { Roles = new HashSet <Role> { new Role { CharacterName = "Axel Foley", ActorName = "Eddie Murphy" } } }, new Movie { Roles = new HashSet <Role> { new Role { CharacterName = "Donkey", ActorName = "Eddie Murphy" } } } }; var movies = new MoviesContext(); movies.Initialise(listOfMovies); Assert.AreEqual(2, movies.RolesByActor("Eddie Murphy").Count); Assert.AreEqual("Axel Foley", movies.RolesByActor("Eddie Murphy").ToArray()[0].CharacterName); Assert.AreEqual("Donkey", movies.RolesByActor("Eddie Murphy").ToArray()[1].CharacterName); }
public void ReadAndWriteMovieProperties() { var movies = new MoviesContext(); Assert.AreEqual(0, movies.Actors.Count); Assert.AreEqual(0, movies.AllMovies.Count); Assert.AreEqual(0, movies.RolesByActor("Eddie Murphy").Count); }