public async Task GetNewPostInvoiceAction_Success( List <DocumentAction> pDocumentActions, [Frozen] IBlue10AsyncClient pBlue10AsyncCLient, InvoiceService pInvoiceService) { // Setup Data foreach (var pDocumentAction in pDocumentActions) { pDocumentAction.Action = EDocumentAction.post_purchase_invoice; } // Setup services pBlue10AsyncCLient.GetDocumentActionsAsync().Returns(pDocumentActions); // Get expections var fExpectedCount = pDocumentActions.Count; // Test var fResult = await pInvoiceService.GetNewPostInvoiceAction(); // Validate await pBlue10AsyncCLient.Received(1).GetDocumentActionsAsync(); fResult.Should().BeOfType <List <DocumentAction> >(); fResult.Count.Should().Be(fExpectedCount); }
public async Task <IList <DocumentAction> > GetNewPostInvoiceAction() { var documentActions = await _blue10.GetDocumentActionsAsync(); var res = documentActions .Where(x => x.Action == EDocumentAction.post_purchase_invoice || x.Action == EDocumentAction.post_block_purchase_invoice) .ToList(); return(res); }
public List <DocumentAction> GetDocumentActions() => mBlue10Async.GetDocumentActionsAsync().Sync();
public async Task <List <DocumentAction> > GetDocumentActions() { return(await mAsyncCLient.GetDocumentActionsAsync()); }