Exemplo n.º 1
0
        public void GenericEquals()
        {
            var t1 = TestMetaData.CreateGenericType();
            var t2 = TestMetaData.CreateGenericType();

            Assert.AreEqual(t1, t2);
        }
Exemplo n.º 2
0
        public void GenericNameWithTwoParams()
        {
            var complex = TestMetaData.CreateGenericType(
                TypeName.Create("System.Int32", "mscorelib"), TypeName.Create("System.Int64", "mscorelib"));

            Assert.AreEqual("TheType_2_Int32_Int64",
                            complex.Name);
        }
Exemplo n.º 3
0
        public void GetsGenericTypeFromCurrentAssembly()
        {
            var dynamicType     = new [] { TestMetaData.CreateGenericType() };
            var dynamicAssembly = CodeGenerator.Create(dynamicType, TestUtils.NewName());
            var typeToFind      = dynamicAssembly.Types[dynamicType.Single(t => t.IsBusinessEntity)];
            var found           = TypeLoader.Create(new string[0])(TypeNameParser.ParseString(ReflectPlatform.FullyQualifiedName(typeToFind)));

            Assert.AreEqual(typeToFind, found.Value);
        }
Exemplo n.º 4
0
        public void CascadedGenericsName()
        {
            var theType = TestMetaData.CreateGenericType();
            var complex = TestMetaData.CreateGenericType(
                TypeName.Create("System.Int32", "mscorelib"), theType.TypeName);

            Assert.AreEqual("TheType_2_Int32_TheType_1_Int32",
                            complex.Name);
        }
Exemplo n.º 5
0
        public void GenericName()
        {
            var theType = TestMetaData.CreateGenericType();

            Assert.AreEqual("TheType_1_Int32", theType.Name);
        }
Exemplo n.º 6
0
        public void ArrayIsNotBusinessType()
        {
            var theType = ArrayDescription.Create(TestMetaData.CreateGenericType(), 1);

            Assert.IsFalse(theType.IsBusinessEntity);
        }
Exemplo n.º 7
0
        public void GeneratedIsBusinessType()
        {
            var theType = TestMetaData.CreateGenericType();

            Assert.IsTrue(theType.IsBusinessEntity);
        }