示例#1
0
        public async Task TestUpdatePost()
        {
            // Create a post
            SalaryTransactionRoot post = new SalaryTransactionRoot
            {
                SalaryTransaction = new SalaryTransaction
                {
                    Number = 15,
                    Amount = 20000M
                }
            };

            // Update the post
            FortnoxResponse<SalaryTransactionRoot> fr = await config.fortnox_client.Update<SalaryTransactionRoot>(post, "salarytransactions/3");

            // 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
            SalaryTransactionRoot post = new SalaryTransactionRoot
            {
                SalaryTransaction = new SalaryTransaction
                {
                    EmployeeId = "1",
                    SalaryCode = "1321",
                    Date = "2016-01-06",
                    Number = 5,
                    Amount = 10000M,
                    CostCenter = "TT2",
                    Project = "A2"
                }
            };

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

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

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

        } // End of the TestAddPost method