Mercurial > pub > bltoolkit
comparison UnitTests/CS/TypeBuilder/NoInstanceAttributeTest.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 | |
3 using NUnit.Framework; | |
4 | |
5 using BLToolkit.Reflection; | |
6 using BLToolkit.TypeBuilder; | |
7 | |
8 namespace TypeBuilder | |
9 { | |
10 [TestFixture] | |
11 public class NoInstanceAttributeTest | |
12 { | |
13 public abstract class PersonCitizenship | |
14 { | |
15 } | |
16 | |
17 public abstract class Person | |
18 { | |
19 [NoInstance] | |
20 public abstract PersonCitizenship Citizenship { get; set; } | |
21 } | |
22 | |
23 [Test] | |
24 public void Text() | |
25 { | |
26 Person person = (Person)TypeAccessor.CreateInstance(typeof(Person)); | |
27 | |
28 Assert.IsNull(person.Citizenship); | |
29 | |
30 person.Citizenship = (PersonCitizenship)TypeAccessor.CreateInstance(typeof(PersonCitizenship)); | |
31 | |
32 Assert.IsNotNull(person.Citizenship); | |
33 } | |
34 } | |
35 } |