public async Task DeleteTest() { //Arrange var producer = new Producer { Id = 1 }; using (var context = new AppDbContext(options)) { var repo = new ProducerRepository(context); //Act var expectedResult = 0; context.Producers.Add(producer); var countAfterAdding = context.Producers.Local.Count(); await repo.Delete(producer.Id); //Assert Assert.AreEqual(expectedResult, context.Producers.Local.Count()); Assert.AreEqual(1, countAfterAdding); } }