Beispiel #1
0
        public void Default_SuccessfullyReturned()
        {
            // Act
            _creditNotePostModel = CreditNoteClient.Default(CreditedIssuedInvoiceId).AssertResult();

            // Assert
            AssertDefault(_creditNotePostModel);
        }
Beispiel #2
0
        public void CreateFromInvoiceWithMoss_SuccessfullyCreated()
        {
            // Act
            var model = CreditNoteClient.Default(InvoiceWithMossId).AssertResult();

            model.CreditNoteReason = "Creadit note reason";
            var result = CreditNoteClient.Post(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);
        }
Beispiel #3
0
        public void OffsetNewCreditNote_SuccessfullyOffset()
        {
            // Arrange
            _creditNoteToOffsetPostModel = CreditNoteClient.Default(CreditedIssuedInvoiceId).AssertResult();
            CreatePostModel(_creditNoteToOffsetPostModel);

            // Act
            var offsetCreditNote = CreditNoteClient.Offset(_creditNoteToOffsetPostModel).AssertResult();

            _offsetCreditNoteId = offsetCreditNote.Id;

            // Assert
            Assert.AreEqual(_offsetCreditNoteId, offsetCreditNote.Id);
            ComparePostAndGetModels(_creditNoteToOffsetPostModel, offsetCreditNote, true);
            ComparePostAndGetItems(_creditNoteToOffsetPostModel.Items, offsetCreditNote.Items.Cast <CreditNoteItemListGetModel>().ToList());
            Assert.IsNotNull(offsetCreditNote.DateOfPayment);
        }