public void ReturnsNullWhenNoValueExists(FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            feature.Id = fixture.Create<string>();

            bool? result = sut.IsEnabled(feature);

            Assert.Equal(null, result);
        }
Esempio n. 2
0
        public void ReturnsNullWhenNoValueExists(FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            feature.Id = fixture.Create <string>();

            bool?result = sut.IsEnabled(feature);

            Assert.Equal(null, result);
        }
        public void ReturnsAppSettingValueWhenSet(string value, bool? expected, FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            // Apparently AutoFixture will reuse the feature
            feature.Id = fixture.Create<string>();

            using (AppSetting.Use($"{AppSettingsToggle.SettingsPrefix}{feature.Id}", value))
            {
                bool? result = sut.IsEnabled(feature);

                Assert.Equal(expected, result);
            }
        }
Esempio n. 4
0
        public void ReturnsAppSettingValueWhenSet(string value, bool?expected, FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            // Apparently AutoFixture will reuse the feature
            feature.Id = fixture.Create <string>();

            using (AppSetting.Use($"{AppSettingsToggle.SettingsPrefix}{feature.Id}", value))
            {
                bool?result = sut.IsEnabled(feature);

                Assert.Equal(expected, result);
            }
        }
 public void ThrowsExceptionWhenGivenNullFeature(AppSettingsToggle sut)
 {
     Assert.Throws<ArgumentNullException>(() => sut.IsEnabled(null));
 }
Esempio n. 6
0
 public void ThrowsExceptionWhenGivenNullFeature(AppSettingsToggle sut)
 {
     Assert.Throws <ArgumentNullException>(() => sut.IsEnabled(null));
 }