コード例 #1
0
        public void ConstructorNameWithFullName()
        {
            // null typeArguments is allowed.
            var t = new MyXamlType("System.Int32", null, sctx);

            Assert.AreEqual("System.Int32", t.Name, "#1");
            Assert.IsNull(t.UnderlyingType, "#2");
            Assert.IsNotNull(t.BaseType, "#3-1");
            // So, it is type aware. It's weird that t.Name still returns full name just as it is passed to the .ctor.
            Assert.AreEqual("Object", t.BaseType.Name, "#3-2");
            Assert.AreEqual(XamlLanguage.Xaml2006Namespace, t.BaseType.PreferredXamlNamespace, "#3-3");
            Assert.IsNull(t.BaseType.BaseType, "#3-4");
            Assert.AreEqual(String.Empty, t.PreferredXamlNamespace, "#4");
            Assert.IsFalse(t.IsArray, "#5");
            Assert.IsFalse(t.IsGeneric, "#6");
            Assert.IsTrue(t.IsPublic, "#7");
            Assert.AreEqual(0, t.GetAllMembers().Count, "#8");
        }
コード例 #2
0
ファイル: XamlTypeTest.cs プロジェクト: spencerhakim/mono
		public void ConstructorNameWithFullName ()
		{
			// null typeArguments is allowed.
			var t = new MyXamlType ("System.Int32", null, sctx);
			Assert.AreEqual ("System.Int32", t.Name, "#1");
			Assert.IsNull (t.UnderlyingType, "#2");
			Assert.IsNotNull (t.BaseType, "#3-1");
			// So, it is type aware. It's weird that t.Name still returns full name just as it is passed to the .ctor.
			Assert.AreEqual ("Object", t.BaseType.Name, "#3-2");
			Assert.AreEqual (XamlLanguage.Xaml2006Namespace, t.BaseType.PreferredXamlNamespace, "#3-3");
			Assert.IsNull (t.BaseType.BaseType, "#3-4");
			Assert.AreEqual (String.Empty, t.PreferredXamlNamespace, "#4");
			Assert.IsFalse (t.IsArray, "#5");
			Assert.IsFalse (t.IsGeneric, "#6");
			Assert.IsTrue (t.IsPublic, "#7");
			Assert.AreEqual (0, t.GetAllMembers ().Count, "#8");
		}