Example #1
0
        public async Task PostAsync_SuccessfullyPosted()
        {
            // Arrange
            CreatePostModel(_creditNotePostModel);

            // Act
            var creditNoteGetModel = (await CreditNoteClient.PostAsync(_creditNotePostModel)).AssertResult();

            _postedCreditNoteId = creditNoteGetModel.Id;

            // Assert
            ComparePostAndGetModels(_creditNotePostModel, creditNoteGetModel, false);
            ComparePostAndGetItems(_creditNotePostModel.Items, creditNoteGetModel.Items.Cast <CreditNoteItemListGetModel>().ToList());
        }
Example #2
0
        public async Task CreateFromInvoiceWithMossAsync_SuccessfullyCreated()
        {
            // Act
            var model = (await CreditNoteClient.DefaultAsync(InvoiceWithMossId)).AssertResult();

            model.CreditNoteReason = "Creadit note reason";
            var result = (await CreditNoteClient.PostAsync(model)).AssertResult();

            // Assert
            Assert.Greater(result.Id, 0);
            Assert.That(result.HasVatRegimeOss, Is.True);
            Assert.AreEqual(result.Items.First().VatRate, 19);

            // Teardown
            CreditNoteClient.Delete(result.Id);
        }