public async Task DefaultAsync_SuccessfullyReturned() { // Act _creditNotePostModel = (await CreditNoteClient.DefaultAsync(CreditedIssuedInvoiceId)).AssertResult(); // Assert AssertDefault(_creditNotePostModel); }
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); }
public async Task OffsetNewCreditNoteAsync_SuccessfullyOffset() { // Arrange var result = (await IssuedDocumentPaymentClient.FullyUnpayAsync(CreditedIssuedInvoiceId)).AssertResult(); Assert.True(result); _creditNoteToOffsetPostModel = (await CreditNoteClient.DefaultAsync(CreditedIssuedInvoiceId)).AssertResult(); CreatePostModel(_creditNoteToOffsetPostModel); // Act var offsetCreditNote = (await CreditNoteClient.OffsetAsync(_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); }