public void DeserializeSubscriptionTest()
        {
            string           jsonRootSubscription = "";
            SubscriptionRoot subscriptionRoot     = JsonToObject.Deserialize <SubscriptionRoot>(jsonRootSubscription);

            Subscriptions.Subscription subscription = subscriptionRoot.Subscription;
            Assert.AreEqual("2", subscription._rallyAPIMajor);
        }
        public void DeserializeProjectTest()
        {
            string      jsonProjectRoot = "";
            ProjectRoot projectRoot     = JsonToObject.Deserialize <ProjectRoot>(jsonProjectRoot);

            Projects.QueryResult project = projectRoot.QueryResult;
            Assert.AreEqual("2", project.Results[0]._rallyAPIMajor);
        }
        public async Task <Projects.QueryResult> GetProjectsAsync(string projectUrl)
        {
            string jsonProjectRoot = await GetCall(projectUrl);

            ProjectRoot projectRoot = JsonToObject.Deserialize <ProjectRoot>(jsonProjectRoot);

            return(projectRoot.QueryResult);
        }
        public async Task <Workspaces.QueryResult> GetWorkspacesAsync(string wkspaceUrl)
        {
            string jsonWorkspaceRoot = await GetCall(wkspaceUrl);

            WorkspaceRoot workspaceRoot = JsonToObject.Deserialize <WorkspaceRoot>(jsonWorkspaceRoot);

            return(workspaceRoot.QueryResult);
        }
        public async Task <Subscriptions.Subscription> GetSubscriptionAsync()
        {
            string url = apiUrl + RallyConstants.RALLY_API_ENDPOINT + RallyConstants.RALLY_SUBSCRIPTION;
            string jsonSubscriptionRoot = await GetCall(url);

            SubscriptionRoot subscriptionRoot = JsonToObject.Deserialize <SubscriptionRoot>(jsonSubscriptionRoot);

            return(subscriptionRoot.Subscription);
        }
        public async Task <Iteration.QueryResult> GetIterationsAsync()
        {
            StringBuilder url = new StringBuilder();

            url.Append(apiUrl + RallyConstants.RALLY_API_ENDPOINT + RallyConstants.RALLY_ITERATION);
            url.Append("?pagesize=" + this.pageSize);
            url.Append("&start=1&order=StartDate DESC,ObjectID");
            url.Append("&fetch=Workspace,Project,ObjectID,Name,Tags,Theme,StartDate,EndDate,PlannedVelocity,PlanEstimate,TaskEstimateTotal,Estimate,TaskRemainingTotal,ToDo,State,TaskActualTotal,Actuals,Blocked,Ready,FormattedID,VersionId");
            url.Append("&compact=" + compactResults);
            //url.Append("&project=/project/35065247868");
            url.Append("&project=" + project);
            url.Append("&projectScopeUp=" + this.projectScopeUp);
            url.Append("&projectScopeDown=" + this.projectScopeDown);

            string jsonIteration = await GetCall(url.ToString());

            IterationRoot iterationRoot = JsonToObject.Deserialize <Iteration.IterationRoot>(jsonIteration);

            return(iterationRoot.QueryResult);
        }
        public async Task <RallyRestApi.Artifacts.QueryResult> GetArtifactAsync(Iteration.Result selectedIteration)
        {
            StringBuilder url = new StringBuilder();

            url.Append(apiUrl + RallyConstants.RALLY_API_ENDPOINT + RallyConstants.RALLY_ARTIFACT);
            url.Append("?pagesize=" + this.pageSize);
            url.Append("&types=hierarchicalrequirement,defect,defectsuite,testset");
            url.Append("&start=1&order=DragAndDropRank ASC,ObjectID");
            url.Append("&query = (((Iteration.Name = \"" + selectedIteration.Name + "\") AND(Iteration.StartDate = \"" + selectedIteration.StartDate + "\")) AND(Iteration.EndDate = \"" + selectedIteration.EndDate + "\")))");
            url.Append("&fetch=PlanEstimate,Release,Iteration,DisplayColor,Project,ObjectID,Name,Tags,DragAndDropRank,FormattedID,ScheduleState,Blocked,Ready,ScheduleStatePrefix,TaskActualTotal,Actuals,Owner,TimeSpent,AcceptedDate,VersionId,Defects,Tasks,TestCases,Children,TaskIndex,Parent,Requirement,DefectSuites,TestCase,sum:[PlanEstimate,TaskActualTotal]");
            url.Append("&compact=" + compactResults);
            //url.Append("&project=/project/35065247868");
            url.Append("&project=" + project);
            url.Append("&projectScopeUp=" + this.projectScopeUp);
            url.Append("&projectScopeDown=" + this.projectScopeDown);

            string jsonArtifact = await GetCall(url.ToString());

            ArtifactRoot artifactRoot = JsonToObject.Deserialize <Artifacts.ArtifactRoot>(jsonArtifact);

            return(artifactRoot.QueryResult);
        }