public void DeleteTagGroupTest() { TagGroup testTG = new TagGroup(0, "Tag Group Name"); int id = restService.postTagGroup(testTG); restService.deleteTagGroup(id.ToString()); TagGroup tagGroup = restService.getTagGroup(id.ToString()); Assert.AreEqual(null, tagGroup); }
public void PostAndGetTagGroupTest() { TagGroup testTG = new TagGroup(0, "Tag Group Name"); int id = restService.postTagGroup(testTG); tagGroupIdList.Add(id); TagGroup checkTag = restService.getTagGroup(id.ToString()); Assert.AreEqual(testTG.name, checkTag.name); }
public Response<TagGroup> postTagGroup(TagGroup tagGroup) { IncomingWebRequestContext requestContext = WebOperationContext.Current.IncomingRequest; Dictionary<string, string> data = new Dictionary<string, string>(); string authString = requestContext.Headers[HttpRequestHeader.Authorization]; data.Add("name", tagGroup.name); Request request = makeRequest(requestContext, trimData(data), authString); TagGroupController controller = new TagGroupController(); return controller.Call(request); }
public void putTagGroupTest() { TagGroup testTG = new TagGroup(0, "Tag Group Name"); int id = restService.postTagGroup(testTG); tagGroupIdList.Add(id); TagGroup editTG = new TagGroup(id, "edited Name"); restService.putTagGroup(id.ToString(), editTG); TagGroup checkTagGroup = restService.getTagGroup(id.ToString()); Assert.AreEqual(editTG.name, checkTagGroup.name); }