Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 115   Methods: 10
NCLOC: 82 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Framework.Log\LoggerTest.cs 100.0% 100.0% 100.0% 100.0%
coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
4   *
5   * Licensed under the Apache License, Version 2.0 (the "License");
6   * you may not use this file except in compliance with the License.
7   * You may obtain a copy of the License at
8   *
9   * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.IO;
21   using System.Reflection;
22   using NUnit.Framework;
23   using Seasar.Framework.Log;
24   using log4net;
25   using log4net.Config;
26   using log4net.Util;
27  
28   namespace Seasar.Tests.Framework.Log
29   {
30   /// <summary>
31   /// LoggerTest の概要の説明です。
32   /// </summary>
33   [TestFixture]
34   public class LoggerTest
35   {
36   private Logger _logger = Logger.GetLogger(typeof(LoggerTest));
37  
38 1 static LoggerTest()
39   {
40 1 FileInfo info = new FileInfo(SystemInfo.AssemblyFileName(
41   Assembly.GetExecutingAssembly()) + ".config");
42 1 XmlConfigurator.Configure(LogManager.GetRepository(), info);
43   }
44  
45 8 [SetUp]
46   public void SetUp()
47   {
48  
49   }
50  
51 1 [Test]
52   public void TestGetLogger()
53   {
54 1 Assert.AreEqual(_logger, Logger.GetLogger(this.GetType()));
55   }
56  
57 1 [Test]
58   public void TestDebug()
59   {
60 1 _logger.Debug("debug");
61   }
62  
63 1 [Test]
64   public void TestInfo()
65   {
66 1 _logger.Info("info");
67   }
68  
69 1 [Test]
70   public void TestWarn()
71   {
72 1 _logger.Warn("warn");
73   }
74  
75 1 [Test]
76   public void TestError()
77   {
78 1 _logger.Error("error");
79   }
80  
81 1 [Test]
82   public void TestFatal()
83   {
84 1 _logger.Fatal("fatal");
85   }
86  
87 1 [Test]
88   public void TestLog()
89   {
90 1 _logger.Log("ESSR0001",new object[] {"test"});
91   }
92  
93 1 [Test]
94   public void TestPerformance()
95   {
96 1 int num = 100;
97 1 long start = DateTime.Now.Ticks;
98 101 for(int i = 0; i < num; ++i)
99   {
100 100 Console.WriteLine("test" + i);
101   }
102 1 long csout = DateTime.Now.Ticks - start;
103 1 start = DateTime.Now.Ticks;
104 101 for(int i = 0; i < num; ++i)
105   {
106 100 _logger.Fatal("test" + i);
107   }
108 1 long logger = DateTime.Now.Ticks - start;
109 1 Console.WriteLine("Console:" + csout);
110 1 Console.WriteLine("Logger:" + logger);
111   }
112  
113   }
114   }
115