public async Task UpdateProductMsp_ShouldReturnTrue_HappyFlow() { orchard1ContextMock.Setup(s => s.ProductType.FindAsync(It.IsAny <int>())).ReturnsAsync(new ProductType() { ProductTypeId = 1, ProductType1 = "tomato", Msp = 50 }); CancellationToken cancellationToken = CancellationToken.None; orchard1ContextMock.Setup(s => s.SaveChangesAsync(cancellationToken)).ReturnsAsync(1); bool testResult = await adminRepository.UpdateProductMsp(new ProductType() { ProductTypeId = 1, ProductType1 = "tomato", Msp = 60 }); Assert.IsTrue(testResult); }
public async Task <bool> UpdateProductMsp(ProductType productType) { return(await _AdminData.UpdateProductMsp(productType)); }