public void AddOrderShouldAdd() { //arrange var options = new DbContextOptionsBuilder <SoilMatesContext>().UseInMemoryDatabase("AddOrderShoudAdd").Options; using var testContext = new SoilMatesContext(options); repo = new DBrepo(testContext); //act repo.AddOrder(testOrder); //assert using var assertContext = new SoilMatesContext(options); Assert.NotNull(assertContext.Orders.SingleAsync(n => n.OrderId == testOrder.OrderId)); }