예제 #1
0
 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);
 }
예제 #2
0
 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);
        }
예제 #4
0
 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);
 }