public void IsMet_MatchesOnMultipleSkipValues(string environmentVariableValue)
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable(environmentVariableValue),
                "Run",
                "false", "", null);

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.True(isMet);
        }
        public void IsMet_DoesNotMatch(string environmentVariableValue)
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable(environmentVariableValue),
                "Run",
                "true");

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.False(isMet);
        }
        public void IsMet_DoesNotMatch_OnMultipleSkipValues()
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable("100"),
                "Build",
                "125", "126");

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.False(isMet);
        }
        public void IsMet_DoesCaseInsensitiveMatch_OnValue(string environmentVariableValue)
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable(environmentVariableValue),
                "Run",
                "true");

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.True(isMet);
            Assert.Equal(
                string.Format(_skipReason, "Run", environmentVariableValue, attribute.SkipOnMatch),
                attribute.SkipReason);
        }
        public void IsMet_DoesSuccessfulMatch_OnNull()
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable(null),
                "Run",
                "true", null); // skip the test when the variable 'Run' is explicitly set to 'true' or is null (default)

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.True(isMet);
            Assert.Equal(
                string.Format(_skipReason, "Run", "(null)", attribute.SkipOnMatch),
                attribute.SkipReason);
        }
        public void IsMet_Matches_WhenSkipOnMatchIsFalse(string environmentVariableValue)
        {
            // Arrange
            var attribute = new SkipInEnvironmentAttribute(
                new TestEnvironmentVariable(environmentVariableValue),
                "LinuxFlavor",
                "Ubuntu14.04")
            {
                // Example: Run this test on all OSes except on "Ubuntu14.04"
                SkipOnMatch = false
            };

            // Act
            var isMet = attribute.IsMet;

            // Assert
            Assert.True(isMet);
        }