Exemplo n.º 1
0
        public void Can_Create_Types_In_A_Non_Xaf_Context()
        {
            new PersistentClassInfo(Session.DefaultSession){Name = "Test"}.Save();
            var typeCreator =
                new TypeCreator(
                    new TypesInfo(new List<Type> {
                                                     typeof (PersistentClassInfo),
                                                     typeof (ExtendedCollectionMemberInfo),
                                                     typeof (ExtendedReferenceMemberInfo),
                                                     typeof (ExtendedCoreTypeMemberInfo),
                                                     typeof (InterfaceInfo)
                                                 }), new UnitOfWork(Session.DefaultSession.DataLayer));

            Type dynamicModule = typeCreator.GetDynamicModule();

            Assert.IsNotNull(dynamicModule);
            Assert.IsNotNull(dynamicModule.Assembly.GetTypes().Where(type => type.Name=="Test").FirstOrDefault());
        }