public async Task ShouldCreateAnewMovieAndDeleteIt(Guid movieId) { var repo = new MoviesMemoryRepository(TimeSpan.FromSeconds(10)); await repo.Add(new Movie() { id = movieId }); await repo.RemoveAll(new List <Guid>() { movieId }); Assert.False(await repo.Any(s => s.id == movieId)); }
public async Task ShouldCreateNewMovie(Guid movieId) { var repo = new MoviesMemoryRepository(TimeSpan.FromSeconds(10)); await repo.Add(new Movie() { id = movieId }); Assert.True(await repo.Any(s => s.id == movieId)); //clean up await repo.RemoveAll(new List <Guid>() { movieId }); }
public async Task ShouldCreateANewMovieAndUpdateIt(Guid movieId) { var original = "Unchanged"; var afterUpdate = "Changed"; var repo = new MoviesMemoryRepository(TimeSpan.FromSeconds(10)); await repo.Add(new Movie() { body = original, id = movieId }); await repo.Update(new Movie() { body = afterUpdate, id = movieId }); Assert.False(await repo.Any(s => s.id == movieId && s.body == original)); Assert.True(await repo.Any(s => s.id == movieId && s.body == afterUpdate)); //clean up await repo.RemoveAll(new List <Guid>() { movieId }); }