コード例 #1
0
 public void OneTimeSetUp()
 {
     InitDokladApi();
     IssuedInvoiceClient    = DokladApi.IssuedInvoiceClient;
     ProformaInvoiceClient  = DokladApi.ProformaInvoiceClient;
     RecurringInvoiceClient = DokladApi.RecurringInvoiceClient;
 }
コード例 #2
0
        public async Task GetDetailAsync_ReturnsRecurringInvoice()
        {
            // Act
            var data = (await RecurringInvoiceClient.Detail(_recurringInvoiceId).GetAsync()).AssertResult();

            // Assert
            AssertGetModel(data);
        }
コード例 #3
0
        public async Task DeleteAsync_SuccessfullyDeleted()
        {
            // Act
            var data = (await RecurringInvoiceClient.DeleteAsync(_recurringInvoiceId)).AssertResult();

            // Assert
            Assert.That(data, Is.True);
        }
コード例 #4
0
        public async Task GetRecurringInvoiceCopyAsync_SuccessfullyGot()
        {
            // Act
            var data = (await RecurringInvoiceClient.CopyAsync(_recurringInvoiceId)).AssertResult();

            // Assert
            Assert.NotNull(data);
            Assert.AreEqual(PartnerId, data.InvoiceTemplate.PartnerId);
        }
コード例 #5
0
        public async Task GetListAsync_ReturnsList()
        {
            // Act
            var data = (await RecurringInvoiceClient.List().GetAsync()).AssertResult();

            // Assert
            Assert.That(data.TotalItems, Is.GreaterThan(0));
            Assert.That(data.TotalPages, Is.GreaterThan(0));
            Assert.That(data.Items, Is.Not.Null.And.Not.Empty);
        }
コード例 #6
0
        public async Task UpdateAsync_SuccessfullyUpdated()
        {
            // Arrange
            var model = CreatePatchModel();

            // Act
            var data = (await RecurringInvoiceClient.UpdateAsync(model)).AssertResult();

            // Assert
            AssertGetModel(data);
        }
コード例 #7
0
        public async Task RecountAsync_SuccessfullyRecounted()
        {
            // Arrange
            var model = CreateRecountPostModel();

            // Act
            var data = (await RecurringInvoiceClient.RecountAsync(model)).AssertResult();

            // Assert
            AssertRecountData(model, data);
        }
コード例 #8
0
        public async Task NextIssueDateAsync_ReturnsCorrectValue()
        {
            // Arrange
            var model = CreateNextIssueDatesPostModel();

            // Act
            var data = (await RecurringInvoiceClient.NextIssueDatesAsync(model)).AssertResult();

            // Assert
            AssertNextIssueData(data);
        }
コード例 #9
0
        public async Task GetListAsync_WithFilter_ReturnsList()
        {
            // Act
            var data = (await RecurringInvoiceClient.List()
                        .Filter(i => i.CompanyName.IsEqual(PartnerName))
                        .Filter(i => i.Id.IsEqual(_recurringInvoiceId))
                        .GetAsync()).AssertResult();

            // Assert
            Assert.That(data.TotalItems, Is.GreaterThan(0));
            Assert.That(data.TotalPages, Is.GreaterThan(0));
            Assert.That(data.Items, Is.Not.Null.And.Not.Empty);
            AssertListGetModel(data.Items.FirstOrDefault());
        }
コード例 #10
0
        public async Task PostAsync_SuccessfullyCreated()
        {
            // Arrange
            var model = CreatePostModel();

            // Act
            var data = (await RecurringInvoiceClient.PostAsync(model)).AssertResult();

            _recurringInvoiceId     = data.Id;
            _recurringInvoiceItemId = data.InvoiceTemplate?.Items?.First()?.Id;
            _issuedInvoiceId        = data.CreatedInvoice?.Id;

            // Assert
            AssertResultGetModel(data);
        }
コード例 #11
0
        public async Task GetDetailAsync_Expand_ReturnsRecurringInvoice()
        {
            // Act
            var data = (await RecurringInvoiceClient.Detail(_recurringInvoiceId)
                        .Include(i => i.InvoiceTemplate.ConstantSymbol)
                        .Include(i => i.InvoiceTemplate.Currency)
                        .Include(i => i.InvoiceTemplate.Partner)
                        .Include(i => i.InvoiceTemplate.PaymentOption)
                        .Include(i => i.InvoiceTemplate.VatReverseChargeCode)
                        .Include(i => i.InvoiceTemplate.Items.PriceListItem)
                        .GetAsync()).AssertResult();

            // Assert
            AssertGetModel(data);
            AssertExpand(data);
        }