Esempio n. 1
0
        public async Task TestUpdatePost()
        {
            // Create a post
            VoucherSeriesRoot post = new VoucherSeriesRoot
            {
                VoucherSeries = new VoucherSeries
                {
                    Code = "X",
                    Description = "Övriga verifikationer",
                    Manual = false
                }
            };

            // Update the post
            FortnoxResponse<VoucherSeriesRoot> fr = await config.fortnox_client.Update<VoucherSeriesRoot>(post, "voucherseries/X");

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

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

        } // End of the TestUpdatePost method
Esempio n. 2
0
        public async Task TestAddPost()
        {
            // Create a post
            VoucherSeriesRoot post = new VoucherSeriesRoot
            {
                VoucherSeries = new VoucherSeries
                {
                    Code = "X",
                    Description = "Other vouchers",
                    Manual = true
                }
            };

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

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

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

        } // End of the TestAddPost method