public void should_parse_pseudo_levels_off()
        {
            LoggerLevels ll = LoggerLevels.Parse("Off");

            // Off implies no level is set.
            Assert.True(ll.All(kvp => kvp.Value == false));
        }
        public void should_parse_pseudo_levels_star()
        {
            LoggerLevels ll = LoggerLevels.Parse("*");

            // * implies all levels are set.
            Assert.True(ll.All(kvp => kvp.Value == true));
        }
 public void test_parser_parity()
 {
     foreach (LoggerLevel level in LoggerLevel.GetValues())
     {
         LoggerLevels ll = null;
         var          ex = Record.Exception(() => ll = LoggerLevels.Parse(level.ToString()));
         Assert.Null(ex);
     }
 }
        public void test_parse_list()
        {
            LoggerLevels a = new LoggerLevels(LoggerLevel.Debug, LoggerLevel.Trace, LoggerLevel.Info);

            Assert.Equal(a, LoggerLevels.Parse("Debug, Trace, Info"));

            LoggerLevels b = new LoggerLevels(LoggerLevel.Debug, LoggerLevel.Trace, LoggerLevel.Info, LoggerLevel.Verbose);

            Assert.Equal(a, LoggerLevels.Parse("Debug\t Trace\t\r Info"));
        }
 public void test_parse_star_per_pattern()
 {
     Assert.Equal(LoggerLevels.All, LoggerLevels.Parse("*"));
 }
 public void test_parse_range_unbounded_above()
 {
     Assert.Equal(LoggerLevels.Above(LoggerLevel.Error), LoggerLevels.Parse("Error:"));
 }
 public void test_parse_range_unbounded_below()
 {
     Assert.Equal(LoggerLevels.Below(LoggerLevel.Error), LoggerLevels.Parse(":Error"));
 }
 public void test_parse_from_all_none()
 {
     Assert.Equal(LoggerLevels.All, LoggerLevels.Parse("All"));
     Assert.Equal(LoggerLevels.None, LoggerLevels.Parse("None"));
 }
 public void test_parse_wildcard()
 {
     Assert.Equal(LoggerLevels.All, LoggerLevels.Parse("*"));
 }
 public void Parse_convert_from_string()
 {
     Assert.Equal("All", LoggerLevels.All.ToString());
     Assert.Equal(LoggerLevels.All, LoggerLevels.Parse("*"));
 }