public async Task AddToHistory() { var options = new DbContextOptionsBuilder <MoviesContext>() .UseInMemoryDatabase(databaseName: "MRAddToHistory") .Options; addHistories(options); using (var context = new MoviesContext(options)) { SQLRepository controller = new SQLRepository(context); string email = "*****@*****.**"; int movieId = 20; await controller.AddToHistory(email, movieId); List <History> fullHistory = controller.GetFullHistory("*****@*****.**"); Assert.Equal(4, fullHistory.Count); } }