Пример #1
0
        public void EmptyStringValuesConvertToNullIfTargetIsNullable()
        {
            var result = (int?)PrefixedAppSettingsReader.ConvertToType("", typeof(int?));

            Assert.That(result == null);
        }
Пример #2
0
        public void ValuesConvertToEnumMembers()
        {
            var result = (LogEventLevel)PrefixedAppSettingsReader.ConvertToType("Information", typeof(LogEventLevel));

            Assert.AreEqual(LogEventLevel.Information, result);
        }
Пример #3
0
        public void ConvertibleValuesConvertToTIfTargetIsNullable()
        {
            var result = (int?)PrefixedAppSettingsReader.ConvertToType("3", typeof(int?));

            Assert.That(result == 3);
        }