public async Task GetCodingSkillById() { var testSkill = (await Get <List <CodingSkill> >(API_URL)).First(); CodingSkill skill = await Get <CodingSkill>($"{API_URL}/{testSkill.Id}"); Assert.True(skill != null, $"Test skill with id {testSkill.Id} should found from the API."); Assert.True(skill.Name == testSkill.Name, $"Found coding skill name doesn't match to testskill's."); Assert.True(skill.Level == testSkill.Level, $"Found coding skill level doesn't match to testskill's."); }
public async Task UpdateCodingSkill() { var testSkill = (await Get <List <CodingSkill> >(API_URL)).First(); var modified = new ModifiedSkill { Name = testSkill.Name + "-334", Level = (int)testSkill.Level != 1 ? testSkill.Level - 1 : CodingSkillLevel.Master }; CodingSkill updatedSkill = await Put <CodingSkill>($"{API_URL}/{testSkill.Id}", modified); Assert.True(updatedSkill != null, $"Test skill with id {testSkill.Id} should found from the API."); Assert.True(updatedSkill.Name == modified.Name, $"Found coding skill name doesn't match to updated one."); Assert.True(updatedSkill.Level == modified.Level, $"Found coding skill level doesn't match to updated one."); }