forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog4NetFactoryTests.cs
More file actions
37 lines (32 loc) · 1.12 KB
/
Copy pathLog4NetFactoryTests.cs
File metadata and controls
37 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.IO;
using NUnit.Framework;
using ServiceStack.Logging.Log4Net;
namespace ServiceStack.Logging.Tests.UnitTests
{
[TestFixture]
public class Log4NetFactoryTests
{
[Test]
public void Log4NetFactoryTest()
{
Log4NetFactory factory = new Log4NetFactory();
ILog log = factory.GetLogger(GetType());
Assert.IsNotNull(log);
Assert.IsNotNull(log as Log4NetLogger);
factory = new Log4NetFactory(true);
log = factory.GetLogger(GetType().Name);
Assert.IsNotNull(log);
Assert.IsNotNull(log as Log4NetLogger);
}
[Test]
public void Log4NetFactoryTestWithExistingConfigFile()
{
const string configFile = "log4net.Test.config";
Assert.IsTrue(File.Exists(configFile), "Test setup failure. Required log4net config file is missing.");
Log4NetFactory factory = new Log4NetFactory(configFile);
ILog log = factory.GetLogger(GetType());
Assert.IsNotNull(log);
Assert.IsNotNull(log as Log4NetLogger);
}
}
}