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(); } }
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(); } }
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(); } }