Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public List <DocumentAction> GetDocumentActions() => mBlue10Async.GetDocumentActionsAsync().Sync();
Beispiel #4
0
 public async Task <List <DocumentAction> > GetDocumentActions()
 {
     return(await mAsyncCLient.GetDocumentActionsAsync());
 }