Exemple #1
0
        public void BuildTestRun_DeserializeTestRun_Test()
        {
            var query    = @"https://bizai.visualstudio.com/DefaultCollection/BizAI/_apis/test/runs?includeRunDetails=true&api-version=1.0&includeRunDetails=true&$top=3";
            var token    = this.config[SolutionConfigName.PERSONAL_ACCESS_TOKEN].ToString();
            var response = VSOApiUtil.GetResponse(query, token);

            var listResponse = JsonConvert.DeserializeObject <TestRunListResponse>(response);

            Assert.IsTrue(listResponse != null);
            Assert.AreEqual(listResponse.value.Count, 3);
        }
        public void PR_DeserializePR_Test()
        {
            var query    = @"https://dltc.visualstudio.com/DefaultCollection/Deep Learning/_apis/git/repositories/Victoria/pullRequests?status=Completed";
            var token    = this.config[SolutionConfigName.PERSONAL_ACCESS_TOKEN].ToString();
            var response = VSOApiUtil.GetResponse(query, token);

            var pullReqeustListResponse = JsonConvert.DeserializeObject <PullRequestListResponse>(response);

            Assert.IsTrue(pullReqeustListResponse.count > 0);
            Assert.AreEqual(pullReqeustListResponse.count, pullReqeustListResponse.value.Count);
        }
        public void OfficialBuild_DeserializeOfficialBuild__Test()
        {
            var query = @"https://dltc.visualstudio.com/DefaultCollection/Deep Learning/_apis/build/builds?api-version=2.0&minFinishTime=2015-08-15T00:00:00Z&maxFinishTime=2018-08-20T00:00:00Z&definitions=18";
            var token = this.config[SolutionConfigName.PERSONAL_ACCESS_TOKEN].ToString();

            var response = VSOApiUtil.GetResponse(query, token);

            var buildListResponse = JsonConvert.DeserializeObject <OfficialBuildListResponse>(response);

            Assert.IsTrue(buildListResponse.count > 0);
            Assert.AreEqual(buildListResponse.count, buildListResponse.value.Count);
        }
        public void TestCoverage_DeserializeTestCoverage_Test()
        {
            var query    = @"https://dltc.visualstudio.com/DefaultCollection/Deep Learning/_apis/test/codeCoverage?api-version=2.0-preview.1&buildId=1370&flags=1";
            var token    = this.config[SolutionConfigName.PERSONAL_ACCESS_TOKEN].ToString();
            var response = VSOApiUtil.GetResponse(query, token);

            var listResponse = JsonConvert.DeserializeObject <TestCoverageListResponse>(response);

            Assert.IsTrue(listResponse != null);
            Assert.AreEqual(listResponse.count, 1);
            Assert.AreEqual(listResponse.count, listResponse.value.Count);
            Assert.AreEqual(listResponse.value[0].modules.Count, 6);
        }
        public void ReleaseTestRun_DeserializeTestRun_Test()
        {
            var query = @"https://bizai.visualstudio.com/BizAI/_apis/test/ResultSummaryByRelease?releaseEnvId=0&releaseId=81";
            var token = this.config[SolutionConfigName.PERSONAL_ACCESS_TOKEN].ToString();

            var response = VSOApiUtil.GetResponse(query, token);

            var listResponse = JsonConvert.DeserializeObject <ResultSummaryResponse>(response);

            Assert.IsTrue(listResponse != null);
            Assert.IsNotNull(listResponse.aggregatedResultsAnalysis);
            Assert.IsNotNull(listResponse.aggregatedResultsAnalysis.resultsByOutcome);
            Assert.IsNull(listResponse.aggregatedResultsAnalysis.resultsByOutcome.Failed);
            Assert.IsNotNull(listResponse.aggregatedResultsAnalysis.resultsByOutcome.Passed);
            Assert.AreEqual(1, listResponse.aggregatedResultsAnalysis.resultsByOutcome.Passed.count);
        }