コード例 #1
0
        public async Task GetEntryAsync_MovieId_ReturnsCorrectMovie()
        {
            var offlineDb = new OfflineDatabase(GetFolder(), new ConsoleLogger());

            offlineDb.LoadMovies();
            var task = offlineDb.GetEntryAsync(Id.FromMovieNumber(280), new CancellationToken(), new Progress <double>());

            var entry = await task;

            Assert.IsFalse(task.IsFaulted);
            Assert.IsFalse(Entry.IsNullOrDefault(entry));
            var movie = entry as Movie;

            Assert.IsNotNull(movie);
            Assert.AreEqual("Terminator 2: Judgment Day", movie.Title);
        }