diff UnitTests/CS/EditableObjects/InnerObjectTest.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UnitTests/CS/EditableObjects/InnerObjectTest.cs	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,40 @@
+using System;
+
+using NUnit.Framework;
+
+using BLToolkit.EditableObjects;
+using BLToolkit.Reflection;
+using BLToolkit.TypeBuilder;
+
+namespace EditableObjects
+{
+	[TestFixture]
+	public class InnerObjectTest
+	{
+		public abstract class TestClass : EditableObject
+		{
+			public abstract TestClass1 Test1 { get; set; }
+		}
+
+		public abstract class TestClass1 : EditableObject
+		{
+			public TestClass1() {}
+			public TestClass1(InitContext ctx) : base() {}
+
+			[NoInstance]
+			public abstract TestClass2 Test2 { get; set; }
+		}
+
+		public abstract class TestClass2 : EditableObject
+		{
+		}
+
+		[Test]
+		public void Test()
+		{
+			TestClass test = (TestClass)TypeAccessor.CreateInstance(typeof(TestClass));
+
+			Assert.IsNull(test.Test1.Test2);
+		}
+	}
+}