public void CanProvideDataNoEnvironmentVariablesSetReturnsFalse()
        {
            var sut = new TeamCityMetaDataResolver(new TestEnvironmentVariables());

            var canProvideData = sut.IsActive();

            Assert.False(canProvideData);
        }
        public void CanProvideDataTeamCityEnvironmentVariableSetReturnsTrue()
        {
            IEnvironmentVariables variables = new TestEnvironmentVariables(new Dictionary <string, string>
            {
                { "TEAMCITY_VERSION", "10.4.5-monsoon" }
            });

            var sut = new TeamCityMetaDataResolver(variables);

            var canProvideData = sut.IsActive();

            Assert.True(canProvideData);
        }
        public void TeamcityNoCustomEnvironmentVariableSetReturnsCorrectResults()
        {
            IEnvironmentVariables variables = new TestEnvironmentVariables(new Dictionary <string, string>
            {
                { "TEAMCITY_VERSION", "10.4.5-monsoon" }
            });

            var sut = new TeamCityMetaDataResolver(variables);

            var canProvideData = sut.IsActive();

            Assert.True(canProvideData);
            var serviceNameResult = sut.ResolveServiceName();

            Assert.True(serviceNameResult.HasValue);
            Assert.Equal("teamcity", serviceNameResult.ValueOrDefault());
            Assert.False(sut.ResolvePullRequestId().HasValue);
            Assert.False(sut.ResolveServiceBuildNumber().HasValue);
            Assert.False(sut.ResolveServiceJobId().HasValue);
        }