public async Task Should_Success_DeleteAsync() { var serviceProvider = GetServiceProvider(); InventorySummaryService inventorySummaryService = new InventorySummaryService(serviceProvider.Object, _dbContext(GetCurrentMethod())); serviceProvider.Setup(s => s.GetService(typeof(IInventorySummaryService))) .Returns(inventorySummaryService); InventoryMovementService inventoryMovementService = new InventoryMovementService(serviceProvider.Object, _dbContext(GetCurrentMethod())); serviceProvider.Setup(s => s.GetService(typeof(IInventoryMovementService))) .Returns(inventoryMovementService); InventoryDocumentService inventoryDocumentFacade = new InventoryDocumentService(serviceProvider.Object, _dbContext(GetCurrentMethod())); serviceProvider.Setup(s => s.GetService(typeof(IInventoryDocumentService))) .Returns(inventoryDocumentFacade); NewFpRegradingResultDocsService service = new NewFpRegradingResultDocsService(serviceProvider.Object, _dbContext(GetCurrentMethod())); var data = await _dataUtil(service).GetTestData(); var Response = await service.DeleteAsync(data.Id); Assert.NotEqual(0, Response); }
public async Task Should_Fail_DeleteAsync() { NewFpRegradingResultDocsService service = new NewFpRegradingResultDocsService(GetFailServiceProvider().Object, _dbContext(GetCurrentMethod())); await Assert.ThrowsAnyAsync <Exception>(() => service.DeleteAsync(0)); }