Exemple #1
0
 public async Task Should_Fail_DeleteAsync()
 {
     var serviceProvider = GetServiceProvider();
     NewFpRegradingResultDocsService   serviceMrn = new NewFpRegradingResultDocsService(serviceProvider.Object, _dbContext(GetCurrentMethod()));
     NewFPReturnInvToPurchasingService service    = new NewFPReturnInvToPurchasingService(serviceProvider.Object, _dbContext(GetCurrentMethod()));
     await Assert.ThrowsAnyAsync <Exception>(() => service.DeleteAsync(0));
 }
Exemple #2
0
        public async Task Should_Success_DeleteAsync()
        {
            var serviceProvider = GetServiceProvider();
            NewFpRegradingResultDocsService serviceMrn = new NewFpRegradingResultDocsService(serviceProvider.Object, _dbContext(GetCurrentMethod()));
            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);
            var mrn = await _dataUtilMrn(serviceMrn).GetTestData();

            serviceProvider.Setup(x => x.GetService(typeof(IFpRegradingResultDocsService)))
            .Returns(serviceMrn);
            NewFPReturnInvToPurchasingService service = new NewFPReturnInvToPurchasingService(serviceProvider.Object, _dbContext(GetCurrentMethod()));
            var data = await _dataUtil(service, serviceMrn).GetTestData();

            var Response = await service.DeleteAsync(data.Id);

            Assert.NotEqual(0, Response);
        }