Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 92   Methods: 7
NCLOC: 79 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Extension.Tx\Impl\RequiredInterceptorTest.cs - 91.3% 100.0% 93.3%
coverage coverage
1   using System;
2   using System.Data;
3   using System.IO;
4   using System.Reflection;
5   using System.Transactions;
6  
7   using log4net;
8   using log4net.Config;
9   using log4net.Util;
10  
11   using NUnit.Framework;
12  
13   using Seasar.Framework.Container.Factory;
14   using Seasar.Framework.Unit;
15  
16   namespace Seasar.Tests.Extension.Tx.Impl
17   {
18   [TestFixture]
19   public class RequiredInterceptorTest : S2FrameworkTestCaseBase
20   {
21   private ITxTest txTest;
22  
23   public ITxTest TxTest
24   {
25 4 get { return txTest; }
26 1 set { txTest = value; }
27   }
28  
29 1 public RequiredInterceptorTest()
30   {
31 1 FileInfo info = new FileInfo(SystemInfo.AssemblyFileName(
32   Assembly.GetExecutingAssembly()) + ".config");
33 1 XmlConfigurator.Configure(LogManager.GetRepository(), info);
34 1 base.Container = S2ContainerFactory.Create(base.ConvertPath("RequiredInterceptorTest.dicon"));
35 1 base.Container.Init();
36 1 this.TxTest = base.GetComponent(typeof(ITxTest)) as ITxTest;
37   }
38  
39 1 [Test]
40   public void StartTx()
41   {
42 1 Assert.AreEqual(true, this.TxTest.IsInTransaction());
43   }
44  
45 1 [Test]
46   public void StartTxInTx()
47   {
48 1 using (TransactionScope scope = new TransactionScope())
49   {
50 1 Transaction tx = Transaction.Current;
51 1 Assert.AreEqual(tx.TransactionInformation.LocalIdentifier,TxTest.TxId);
52   }
53   }
54  
55 1 [Test]
56   public void ThrowException()
57   {
58 1 try
59   {
60 1 this.TxTest.throwException();
61 0 Assert.Fail();
62   }
63   catch (TxException e)
64   {
65 1 Assert.IsTrue(e.WasInTx);
66   }
67   }
68  
69 1 [Test]
70   public void ThrowExceptionInTx()
71   {
72 1 using (TransactionScope scope = new TransactionScope())
73   {
74 1 Transaction tx = Transaction.Current;
75 1 try
76   {
77 1 this.TxTest.throwException();
78 0 Assert.Fail();
79   }
80   catch (TxException e)
81   {
82 1 Assert.IsTrue(e.WasInTx);
83 1 Assert.AreEqual(tx.TransactionInformation.LocalIdentifier, e.TxId);
84   }
85  
86 1 Assert.IsTrue(tx.TransactionInformation.Status == TransactionStatus.Aborted);
87   }
88  
89   }
90   }
91   }
92