Example #1
0
        public void SettingConfigurationAttributeGetDefinitionReturnsNonNullToggleDefinition()
        {
            // Arrange
            var sut = new SettingConfigurationAttribute("onToggle");

            // Act
            var result = sut.GetDefinition(typeof(ConfigurationFileToggle));

            // Assert
            result.Should().NotBeNull();
        }
Example #2
0
        public void SettingConfigurationAttributeGetDefinitionReturnsEvaluationThatReturnsTrueWhenSettingIsNotPresent()
        {
            // Arrange
            var sut        = new SettingConfigurationAttribute("NotPresentSetting");
            var definition = sut.GetDefinition(typeof(ConfigurationFileToggle));

            // Act
            var result = definition.Evaluation();

            // Assert
            result.Should().BeTrue();
        }
Example #3
0
        public void SettingConfigurationAttributeGetDefinitionReturnsEvaluationThatMatchesSettingValue()
        {
            // Arrange
            var sut          = new SettingConfigurationAttribute("onToggle");
            var settingValue = bool.Parse(ConfigurationManager.AppSettings["onToggle"]);
            var definition   = sut.GetDefinition(typeof(ConfigurationFileToggle));

            // Act
            var result = definition.Evaluation();

            // Assert
            result.Should().Be(settingValue);
        }