public void CoverallsData_PullRequestId_PullsFromGitData()
        {
            Environment.SetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER", "b31f08d07ae564b08237e5a336e478b24ccc4a65");
            var git = new AppVeyorGit();

            var coverallsData = new CoverallsData
            {
                ServiceName = "ServiceName",
                ServiceJobId = "JobId",
                RepoToken = "b31f08d07ae564b08237e5a336e478b24ccc4a65",
                SourceFiles = (new List<CoverageFile>()).ToArray(),
                Git = git.Data
            };

            coverallsData.ServicePullRequest.Should().Be("b31f08d07ae564b08237e5a336e478b24ccc4a65");
        }
        public void CoverallsData_NullPullRequestId_IsNotInJSON()
        {
            var git = new AppVeyorGit();

            var coverallsData = new CoverallsData
            {
                ServiceName = "ServiceName",
                ServiceJobId = "JobId",
                RepoToken = "b31f08d07ae564b08237e5a336e478b24ccc4a65",
                SourceFiles = (new List<CoverageFile>()).ToArray(),
                Git = git.Data
            };

            var json = JsonConvert.SerializeObject(coverallsData);

            json.Should().NotContain("service_pull_request");
        }
        public void CoverallsData_BlankPullRequestId_IsNotInJSON()
        {
            Environment.SetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER", "");
            var git = new AppVeyorGit();

            var coverallsData = new CoverallsData
            {
                ServiceName = "ServiceName",
                ServiceJobId = "JobId",
                RepoToken = "b31f08d07ae564b08237e5a336e478b24ccc4a65",
                SourceFiles = (new List<CoverageFile>()).ToArray(),
                Git = git.Data
            };

            var json = JsonConvert.SerializeObject(coverallsData);

            json.Should().NotContain("service_pull_request");
        }