public void DataCacheTests_GetAllEntries() { IMovieData movieData = new DummyMovieData(); IDataCache dataCache = new DataCache(movieData); var movies = dataCache.GetAllEntries(); Console.WriteLine(JsonConvert.SerializeObject(movies)); }
public void DataCacheTests_DeleteMovie() { IMovieData movieData = new DummyMovieData(); IDataCache dataCache = new DataCache(movieData); dataCache.DeleteEntry(DummyMovies.SingleMovie.imdbID); Console.WriteLine(); }
public void DataCacheTests_EditEntry() { IMovieData movieData = new DummyMovieData(); IDataCache dataCache = new DataCache(movieData); dataCache.EditEntry(DummyMovies.SingleMovie.imdbID, DummyMovies.SingleMovie); Console.WriteLine(); }
public void DataCacheTests_AddNewEntry() { IMovieData movieData = new DummyMovieData(); IDataCache dataCache = new DataCache(movieData); dataCache.AddNewEntry(DummyMovies.NewMovie); Console.WriteLine(); }
public void MovieLogicTests_PutCachedMovieExisting() { IOMDbConnection omdbConnection = new DummyOMDbCon(); IDataCache dataCache = new DummyDataCache(); IMovieData movieData = new DummyMovieData(); IMovieLogic movieLogic = new MovieLogic(omdbConnection, dataCache, movieData); movieLogic.PutCachedMovie("00000", DummyMovies.NewMovie); Console.WriteLine(); }
public void MovieLogicTests_GetCachedMovies() { IOMDbConnection omdbConnection = new DummyOMDbCon(); IDataCache dataCache = new DummyDataCache(); IMovieData movieData = new DummyMovieData(); IMovieLogic movieLogic = new MovieLogic(omdbConnection, dataCache, movieData); var movies = movieLogic.GetCachedMovies(); Console.WriteLine(JsonConvert.SerializeObject(movies)); }
public void MovieLogicTests_SearchMoviesByTitleAndYear() { IOMDbConnection omdbConnection = new DummyOMDbCon(); IDataCache dataCache = new DummyDataCache(); IMovieData movieData = new DummyMovieData(); IMovieLogic movieLogic = new MovieLogic(omdbConnection, dataCache, movieData); var movie = movieLogic.SearchMoviesByTitle("Movie1", "1990").Result; Console.WriteLine(JsonConvert.SerializeObject(movie)); }
public void MovieLogicTests_SearchMoviesByID() { IOMDbConnection omdbConnection = new DummyOMDbCon(); IDataCache dataCache = new DummyDataCache(); IMovieData movieData = new DummyMovieData(); IMovieLogic movieLogic = new MovieLogic(omdbConnection, dataCache, movieData); var movie = movieLogic.SearchMoviesByID("00000").Result; Console.WriteLine(""); }
public void MovieLogicTests_DelCachedMovie() { IOMDbConnection omdbConnection = new DummyOMDbCon(); IDataCache dataCache = new DummyDataCache(); IMovieData movieData = new DummyMovieData(); IMovieLogic movieLogic = new MovieLogic(omdbConnection, dataCache, movieData); movieLogic.DelCachedMovie("00000"); Console.WriteLine(); }
public void DataCacheTests_AddOldEntry() { IMovieData movieData = new DummyMovieData(); IDataCache dataCache = new DataCache(movieData); try { dataCache.AddNewEntry(DummyMovies.SingleMovie); } catch (Exception ex) { if (ex.Message != "Movie allready in cache.") { throw ex; } } Console.WriteLine(); }