comparison UnitTests/CS/Aspects/LoggingAspectTest.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.Collections;
3
4 using BLToolkit.Aspects;
5 using BLToolkit.Reflection;
6
7 using NUnit.Framework;
8
9 namespace Aspects
10 {
11 [TestFixture]
12 public class LoggingAspectTest
13 {
14 [Log]
15 public abstract class TestClass
16 {
17 public abstract int Test();
18
19 [Log("LogParameters=true")]
20 public virtual void Test(ArrayList list, int i, string s, char c)
21 {
22 }
23
24 [Log("LogParameters=true")]
25 public virtual void Test(int i)
26 {
27 throw new ApplicationException("test exception");
28 }
29 }
30
31 [Test]
32 public void Test1()
33 {
34 TestClass t = (TestClass)TypeAccessor.CreateInstance(typeof(TestClass));
35
36 t.Test();
37 t.Test(new ArrayList(), 567, "876", 'X');
38 }
39
40 [Test, ExpectedException(typeof(ApplicationException))]
41 public void Test2()
42 {
43 TestClass t = (TestClass)TypeAccessor.CreateInstance(typeof(TestClass));
44
45 t.Test(123);
46 }
47 }
48 }