public async Task TestAddPost() { // Create a post AbsenceTransactionRoot post = new AbsenceTransactionRoot { AbsenceTransaction = new AbsenceTransaction { EmployeeId = "1", CauseCode = "SJK", Date = "2018-09-08", Extent = 65.00M } }; // Add the post FortnoxResponse<AbsenceTransactionRoot> fr = await config.fortnox_client.Add<AbsenceTransactionRoot>(post, "absencetransactions"); // Log the error if (fr.model == null) { config.logger.LogError(fr.error); } // Test evaluation Assert.AreNotEqual(null, fr.model); } // End of the TestAddPost method
public async Task TestUpdatePost() { // Create a post AbsenceTransactionRoot post = new AbsenceTransactionRoot { AbsenceTransaction = new AbsenceTransaction { Hours = 6M } }; // Update the post FortnoxResponse<AbsenceTransactionRoot> fr = await config.fortnox_client.Update<AbsenceTransactionRoot>(post, "absencetransactions/1/2018-09-10/SJK"); // Log the error if (fr.model == null) { config.logger.LogError(fr.error); } // Test evaluation Assert.AreNotEqual(null, fr.model); } // End of the TestUpdatePost method