コード例 #1
0
        public async Task TestUpdatePost()
        {
            // Create a post
            SupplierInvoicePaymentRoot post = new SupplierInvoicePaymentRoot
            {
                SupplierInvoicePayment = new SupplierInvoicePayment
                {
                    Amount = 945M,
                    AmountCurrency = 945M,
                    InvoiceNumber = "2",
                    WriteOffs = new List<WriteOff>
                    {
                        new WriteOff
                        {
                            AccountNumber = "6570",
                            Amount = 55M
                        }
                    }
                }
            };

            // Update the post
            FortnoxResponse<SupplierInvoicePaymentRoot> fr = await config.fortnox_client.Update<SupplierInvoicePaymentRoot>(post, "supplierinvoicepayments/4");

            // 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
            SupplierInvoicePaymentRoot post = new SupplierInvoicePaymentRoot
            {
                SupplierInvoicePayment = new SupplierInvoicePayment
                {
                    Amount = 110M,
                    AmountCurrency = 110M,
                    InvoiceNumber = "2"
                }
            };

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

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

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

        } // End of the TestAddPost method