2009-04-17 06:28:21 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using NUnit.Framework.SyntaxHelpers;
|
|
|
|
|
|
|
|
|
|
namespace SimpleLog.Tests {
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class LoggerManagerTest {
|
|
|
|
|
|
2009-04-19 22:10:13 +00:00
|
|
|
|
[SetUp]
|
|
|
|
|
public void SetUp() {
|
|
|
|
|
LoggerManager.LoadConfig(null);
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-17 06:28:21 +00:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestGetLogger() {
|
2009-04-19 22:10:13 +00:00
|
|
|
|
DefaultLogger logger = LoggerManager.GetLogger(typeof(DefaultLogger)) as DefaultLogger;
|
2009-04-17 06:28:21 +00:00
|
|
|
|
Assert.That(logger, Is.TypeOf(typeof(DefaultLogger)));
|
2009-04-19 22:10:13 +00:00
|
|
|
|
DefaultLogger logger2 = LoggerManager.GetLogger(typeof(DefaultLogger)) as DefaultLogger;
|
2009-04-17 06:28:21 +00:00
|
|
|
|
Assert.That(logger2, Is.TypeOf(typeof(DefaultLogger)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[ExpectedException("System.ArgumentException")]
|
|
|
|
|
public void TestGetLoggerThrowsArgumentException() {
|
2009-04-19 22:10:13 +00:00
|
|
|
|
LoggerManager.GetLogger(typeof(object));
|
2009-04-17 06:28:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|