示例#1
0
        public async Task TestUpdatePost()
        {
            // Create a post
            InvoicePaymentRoot post = new InvoicePaymentRoot
            {
                InvoicePayment = new InvoicePayment
                {
                    Amount = 70M,
                    AmountCurrency = 100M,
                    InvoiceNumber = "2",
                    WriteOffs = new List<WriteOff>
                    {
                        new WriteOff
                        {
                            AccountNumber = "6570",
                            Amount = 55M
                        }
                    }
                }
            };

            // Update the post
            FortnoxResponse<InvoicePaymentRoot> fr = await config.fortnox_client.Update<InvoicePaymentRoot>(post, "invoicepayments/5");

            // Log the error
            if (fr.model == null)
            {
                config.logger.LogError(fr.error);
            }

            // Test evaluation
            Assert.AreNotEqual(null, fr.model);

        } // End of the TestUpdatePost method
示例#2
0
        public async Task TestAddPost()
        {
            // Create a post
            InvoicePaymentRoot post = new InvoicePaymentRoot
            {
                InvoicePayment = new InvoicePayment
                {
                    Amount = 75M,
                    AmountCurrency = 75M,
                    InvoiceNumber = "2"
                }
            };

            // Add the post
            FortnoxResponse<InvoicePaymentRoot> fr = await config.fortnox_client.Add<InvoicePaymentRoot>(post, "invoicepayments");

            // Log the error
            if (fr.model == null)
            {
                config.logger.LogError(fr.error);
            }

            // Test evaluation
            Assert.AreNotEqual(null, fr.model);

        } // End of the TestAddPost method