public void ArchiveProductShouldWorkCorrectly() { var options = new DbContextOptionsBuilder <BankCloudDbContext>() .UseInMemoryDatabase(databaseName: "Archive_Product_Database") .Options; var dbContext = new BankCloudDbContext(options); var productService = new ProductsService(dbContext, null); var loanId = "123"; var saveId = "321"; var productLoan = new Loan { Id = loanId, Name = "ABC", IsDeleted = false }; var productSave = new Save { Id = saveId, Name = "CBA", IsDeleted = false }; dbContext.Products.Add(productLoan); dbContext.Products.Add(productSave); dbContext.SaveChanges(); productService.ArchiveProduct(loanId); productService.ArchiveProduct(saveId); var loan = dbContext.Products.Find(loanId); var save = dbContext.Products.Find(saveId); Assert.True(loan.IsDeleted); Assert.True(save.IsDeleted); }