public async Task Should_Success_GetReport_with_order() { //Setup var serviceProvider = GetServiceProvider(); InventoryDbContext dbContext = _dbContext(GetCurrentMethod()); InventorySummaryService inventorySummaryService = new InventorySummaryService(serviceProvider.Object, dbContext); serviceProvider.Setup(s => s.GetService(typeof(IInventorySummaryService))) .Returns(inventorySummaryService); InventoryMovementService inventoryMovementService = new InventoryMovementService(serviceProvider.Object, dbContext); serviceProvider.Setup(s => s.GetService(typeof(IInventoryMovementService))) .Returns(inventoryMovementService); InventoryDocumentService inventoryDocumentFacade = new InventoryDocumentService(serviceProvider.Object, dbContext); serviceProvider.Setup(s => s.GetService(typeof(IInventoryDocumentService))) .Returns(inventoryDocumentFacade); NewFpRegradingResultDocsService service = new NewFpRegradingResultDocsService(serviceProvider.Object, dbContext); var data = await _dataUtil(service).GetTestData(); var orderProperty = new { Code = "desc" }; string order = JsonConvert.SerializeObject(orderProperty); //Act var model = service.GetReport(null, null, null, null, null, null, null, 1, 25, order); //Assert Assert.NotNull(model); }
public async Task Should_Success_GetReport() { 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 model = service.GetReport(null, null, null, null, null, null, null, 1, 25, "{}"); Assert.NotNull(model); }