Ejemplo n.º 1
0
        public void HasMetaDataForConflictingTypes()
        {
            var     originalMetaData = TestMetaData.CreateNameConflicMetaInfo();
            dynamic metaData         = MetaClassInfo(originalMetaData);

            Assert.NotNull(metaData.ANamespace.EmptyClass);
            Assert.NotNull(metaData.ANamespace.OtherNamespace.EmptyClass);
        }
Ejemplo n.º 2
0
        public void CanDealWithNamespaceConflicts()
        {
            var typeInfos = TestMetaData.CreateNameConflicMetaInfo();
            var result    = CodeGenerator.Create(typeInfos, TestUtils.NewName());
            var types     = from t in result.Types
                            select t.Value;

            Assert.IsTrue(types.Any(t => t.Namespace.EndsWith(TestMetaData.Namespace) && t.Name.StartsWith(TestMetaData.EmptyClassName)));
            Assert.IsTrue(types.Any(t =>
                                    t.Namespace.EndsWith(TestMetaData.Namespace + "." + TestMetaData.SubNamespace) &&
                                    t.Name.StartsWith(TestMetaData.EmptyClassName)));
        }
Ejemplo n.º 3
0
        public void AddsConflictingNamesToNamespaces()
        {
            var     typeInfos    = TestMetaData.CreateNameConflicMetaInfo();
            var     result       = CodeGenerator.Create(typeInfos, TestUtils.NewName());
            dynamic theNamespace = result.DataContext.GetProperty(TestMetaData.Namespace).GetValue(null, null);

            TestUtils.WithTestContext(
                () =>
            {
                Assert.NotNull(theNamespace.EmptyClass);
                Assert.NotNull(theNamespace.OtherNamespace);
                Assert.NotNull(theNamespace.OtherNamespace.EmptyClass);
            });
        }