Example #1
0
        public void Post_SuccessfullyCreated()
        {
            // Arrange
            _issuedInvoicePostModel                   = _issuedInvoiceClient.Default().AssertResult();
            _issuedInvoicePostModel.PartnerId         = PartnerId;
            _issuedInvoicePostModel.DeliveryAddressId = DeliveryAddressId1;
            _issuedInvoicePostModel.Description       = "Invoice";
            _issuedInvoicePostModel.Items.Clear();
            _issuedInvoicePostModel.Items.Add(new IssuedInvoiceItemPostModel
            {
                Name      = "Test",
                UnitPrice = 100
            });

            // Act
            var data = _issuedInvoiceClient.Post(_issuedInvoicePostModel).AssertResult();

            _issuedInvoiceId = data.Id;

            // Assert
            Assert.Greater(data.Id, 0);
            Assert.AreEqual(_issuedInvoicePostModel.DateOfIssue, data.DateOfIssue);
            Assert.AreEqual(PartnerId, data.PartnerId);
            Assert.Greater(data.Items.Count, 0);
            AssertDeliveryAddress(data.DeliveryAddress, DeliveryAddressId1);
        }
Example #2
0
        private IssuedInvoiceGetModel CreateInvoice()
        {
            var defaultInvoice = _issuedInvoiceClient.Default().AssertResult();

            defaultInvoice.PartnerId   = PartnerId;
            defaultInvoice.Description = "Invoice for pair";
            defaultInvoice.Items.Clear();
            defaultInvoice.Items.Add(new IssuedInvoiceItemPostModel
            {
                Name      = "Test",
                Amount    = 1,
                UnitPrice = 150
            });
            var invoice = _issuedInvoiceClient.Post(defaultInvoice).AssertResult();

            return(invoice);
        }