Esempio n. 1
0
        public void ConstructorTest3()
        {
            TypeInfo     typeInfo = typeof(string).GetTypeInfo();
            TypeNameInfo target   = new TypeNameInfo(typeInfo);

            Assert.Inconclusive("TypeNameInfoUnitTest.ConstructorTest3 not implemented.");
        }
Esempio n. 2
0
        public void ConstructorTest1()
        {
            Type         type   = typeof(string);
            TypeNameInfo target = new TypeNameInfo(type);

            Assert.Inconclusive("TypeNameInfoUnitTest.ConstructorTest1 not implemented.");
        }
Esempio n. 3
0
        protected override void ValidateElement(object element)
        {
            Monitor.Enter(_syncRoot);
            try
            {
                if (element == null)
                {
                    if (AllowNull)
                    {
                        return;
                    }
                    throw new ValidationMetadataException("Value cannot be null");
                }

                TypeNameInfo typeName = TypeNameInfo.AsTypeNameInfo(element);

                if (string.IsNullOrWhiteSpace(typeName.FullName))
                {
                    if (AllowEmpty)
                    {
                        return;
                    }
                    throw new ValidationMetadataException("Value cannot be empty");
                }

                if (!TypeNameInfo.IsValidLanguageIndependentFullName(typeName.TypeReference))
                {
                    throw new ValidationMetadataException("Invalid language-independent identifier");
                }
            }
            finally { Monitor.Exit(_syncRoot); }
        }
Esempio n. 4
0
        public void ConstructorTest4()
        {
            TypeInfo          typeInfo = typeof(string).GetTypeInfo();
            TypeNamespaceInfo parent   = new TypeNamespaceInfo("System");
            TypeNameInfo      target   = new TypeNameInfo(typeInfo, parent);

            Assert.Inconclusive("TypeNameInfoUnitTest.ConstructorTest4 not implemented.");
        }
Esempio n. 5
0
        public void ParentTest()
        {
            Type                  type   = typeof(string);
            TypeNameInfo          target = new TypeNameInfo(type);
            ITypeNamingIdentifier actual = target.Parent;

            Assert.IsNotNull(actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.ParentTest not implemented.");
        }
Esempio n. 6
0
        public void ToStringTest()
        {
            Type         type   = typeof(string);
            TypeNameInfo target = new TypeNameInfo(type);
            string       actual = target.ToString();

            Assert.IsNotNull(actual);
            Assert.AreEqual(type.FullName, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.ToStringTest not implemented.");
        }
Esempio n. 7
0
        public void GetHashCodeTest()
        {
            Type         type     = typeof(string);
            TypeNameInfo target   = new TypeNameInfo(type);
            int          expected = type.FullName.GetHashCode();
            int          actual   = target.GetHashCode();

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.GetHashCodeTest not implemented.");
        }
Esempio n. 8
0
        public void EqualsTest1()
        {
            Type         type     = typeof(string);
            TypeNameInfo target   = new TypeNameInfo(type);
            TypeNameInfo other    = null;
            bool         expected = false;
            bool         actual   = target.Equals(other);

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.EqualsTest1 not implemented.");
        }
Esempio n. 9
0
        public void CompareToTest2()
        {
            Type         type     = typeof(string);
            TypeNameInfo target   = new TypeNameInfo(type);
            string       other    = null;
            int          expected = 1;
            int          actual   = target.CompareTo(other);

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.CompareToTest2 not implemented.");
        }
Esempio n. 10
0
        public void BaseTypeTest()
        {
            Type         type     = typeof(string);
            TypeNameInfo target   = new TypeNameInfo(type);
            TypeNameInfo other    = null;
            string       expected = "System.Object";
            string       actual   = target.BaseType;

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.BaseTypeTest not implemented.");
        }
Esempio n. 11
0
        public void IConvertibleTest()
        {
            Type         type   = typeof(string);
            IConvertible target = new TypeNameInfo(type);
            object       actual = target.ToType(type, null);

            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, type);
            Assert.AreEqual(type.FullName, (string)actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.IConvertibleTest not implemented.");
        }
Esempio n. 12
0
        public void GenericArgumentCountTest()
        {
            Type         type     = typeof(string);
            TypeNameInfo target   = new TypeNameInfo(type);
            TypeNameInfo other    = null;
            int          expected = 0;
            int          actual   = target.GenericArgumentCount;

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("TypeNameInfoUnitTest.GenericArgumentCountTest not implemented.");
        }