Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 67   Methods: 4
NCLOC: 42 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Framework.Message\MessageFormatterTest.cs - 92.3% 100.0% 94.1%
coverage 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.Reflection;
21   using System.Resources;
22  
23   using NUnit.Framework;
24  
25   using Seasar.Framework.Message;
26  
27   namespace Seasar.Tests.Framework.Message
28   {
29   [TestFixture]
30   public class MessageFormatterTest
31   {
32 1 public MessageFormatterTest()
33   {
34   }
35  
36 1 [Test]
37   public void TestGetMessage() {
38 1 string message = MessageFormatter.GetMessage("ESSR0001", new object[]{"test"});
39 1 Assert.AreEqual("[ESSR0001] testが見つかりません", message, "メッセージリソースを取得出来る事");
40  
41   }
42  
43 1 [Test]
44   public void TestGetMessage2() {
45 1 Assembly asm = Assembly.GetExecutingAssembly();
46 1 string message = MessageFormatter.GetMessage("ETST0001", new object[]{"test"}, asm);
47 1 ResourceManager rm = new ResourceManager("TSTMessages",asm);
48 1 try {
49 1 Console.WriteLine(rm.GetString("ETST0001"));
50   } catch(Exception e) {
51 0 Console.WriteLine(e.StackTrace);
52   }
53 1 Assert.AreEqual("[ETST0001] test message", message , "メッセージリソースを取得出来る事");
54   }
55  
56 1 [Test]
57   public void TestGetMessage3()
58   {
59 1 string message = MessageFormatter.GetMessage("ESSR0001", new object[]{"test"});
60 1 Assert.AreEqual("[ESSR0001] testが見つかりません", message, "メッセージリソースを取得出来る事");
61 1 message = MessageFormatter.GetMessage("ESSR0001", new object[]{"test"});
62 1 Assert.AreEqual("[ESSR0001] testが見つかりません", message, "メッセージリソースを取得出来る事");
63   }
64  
65   }
66   }
67