示例#1
0
        public void Resolver_OverwritesConstructor()
        {
            try {
                Bilge.SetConfigurationResolver((nm, def) => {
                    return(SourceLevels.Verbose);
                });
                Bilge b = new Bilge();

                Assert.Equal(SourceLevels.Verbose, b.ActiveTraceLevel);
            } finally {
                Bilge.ClearConfigurationResolver();
            }
        }
示例#2
0
 public void Resolver_GetsName()
 {
     try {
         const string INAME = "InstanceName";
         Bilge.SetConfigurationResolver((nm, def) => {
             Assert.Equal(INAME, nm);
             return(SourceLevels.Off);
         });
         Bilge b = new Bilge(INAME);
     } finally {
         Bilge.ClearConfigurationResolver();
     }
 }
示例#3
0
        public void Resolver_GetsInitialValue()
        {
            try {
                const string INAME = "InstanceName";

                Bilge.SetConfigurationResolver((nm, def) => {
                    Assert.Equal <SourceLevels>(SourceLevels.Critical, def);
                    return(SourceLevels.Off);
                });

                Bilge b = new Bilge(INAME, tl: SourceLevels.Critical);
            } finally {
                Bilge.ClearConfigurationResolver();
            }
        }