public void GetAllTest() { //Arrange var producers = new List <Producer> { new Producer { Id = 1, }, new Producer { Id = 2 }, new Producer { Id = 3 }, }; using (var context = new AppDbContext(options)) { var repo = new ProducerRepository(context); //Act foreach (var producer in producers) { context.Producers.Add(producer); } var result = repo.GetAll(); //Assert Assert.AreEqual(context.Orders, result); } }