public void ConfigureToString() { HConsole.Configure <object>(x => x .SetIndent(4) .SetMaxLevel(3)); var o = new object(); HConsole.Configure(o, x => x .SetPrefix("XX") .SetMaxLevel(4)); Assert.That(HConsole.GetConfig(o).ToString(), Is.EqualTo("{Config: 4, \"XX\", 4}")); }
public void Configure() { HConsole.Configure <object>(x => x .SetIndent(4) .SetPrefix("XX") .SetMaxLevel(3)); var config = HConsole.GetConfig(new object()); Assert.That(config.Prefix, Is.EqualTo("XX")); Assert.That(config.Indent, Is.EqualTo(4)); Assert.That(config.MaxLevel, Is.EqualTo(3)); HConsole.Configure <object>(x => x .ClearIndent() .ClearPrefix() .ClearMaxLevel()); config = HConsole.GetConfig(new object()); Assert.That(config.Prefix, Is.Null); Assert.That(config.Indent, Is.EqualTo(0)); Assert.That(config.MaxLevel, Is.EqualTo(-1)); HConsole.ClearConfiguration <object>(); var o = new object(); HConsole.Configure(o, x => x .SetIndent(4) .SetPrefix("XX") .SetMaxLevel(3)); config = HConsole.GetConfig(o); Assert.That(config.Prefix, Is.EqualTo("XX")); Assert.That(config.Indent, Is.EqualTo(4)); Assert.That(config.MaxLevel, Is.EqualTo(3)); HConsole.ClearConfiguration(o); config = HConsole.GetConfig(o); Assert.That(config.Prefix, Is.Null); Assert.That(config.Indent, Is.EqualTo(0)); Assert.That(config.MaxLevel, Is.EqualTo(-1)); }