Ejemplo n.º 1
0
 public void SetUp()
 {
     IAssemblyFinder assemblyFinder = new AssemblyFinder();
     ITypeFinder typeFinder = new TypeFinder(assemblyFinder);
     ContentTypeBuilder contentTypeBuilder = new ContentTypeBuilder(typeFinder, null, null, null, null, null);
     _definitionManager = new ContentTypeManager(contentTypeBuilder, null);
 }
Ejemplo n.º 2
0
        public void Can_Query_Detail()
        {
            IAssemblyFinder assemblyFinder = new AssemblyFinder();
            ITypeFinder typeFinder = new TypeFinder(assemblyFinder);
            IContentTypeBuilder contentTypeBuilder = new ContentTypeBuilder(typeFinder, null, null, null, null, null);
            IItemNotifier itemNotifier = new ItemNotifier();
            IContentTypeManager contentTypeManager = new ContentTypeManager(contentTypeBuilder, itemNotifier);
            IConfigurationBuilder configurationBuilder = new ConfigurationBuilder(contentTypeManager, ConfigurationManager.GetSection("zeus/database") as DatabaseSection);
            ISessionProvider sessionProvider = new SessionProvider(configurationBuilder, new NotifyingInterceptor(new ItemNotifier()), new ThreadContext());

            /*var results = itemFinder.Find<NewsContainer>(
                //ci => ci.Details.Values.OfType<StringDetail>().Any(cd => cd.Name == "Text" && cd.StringValue == "sdfds")
                //ci => ci.Details.OfType<StringDetail>().Where(cd => cd.Name == "DetailName").SingleOrDefault().StringValue == "Hello"
                ci => ci.Text == "sdfds" //&& ci.MyProperty.StartsWith("Hell")
            );
            Assert.GreaterThanOrEqualTo(Enumerable.Count(results), 1);*/
        }
Ejemplo n.º 3
0
        public override void SetUp()
        {
            base.SetUp();

            CreatePersister();

            parser = mocks.StrictMock<IUrlParser>();

            ITypeFinder typeFinder = CreateTypeFinder();
            ContentTypeBuilder builder = new ContentTypeBuilder(typeFinder, new EditableHierarchyBuilder<IEditor>(),
                new AttributeExplorer<IDisplayer>(), new AttributeExplorer<IEditor>(),
                new AttributeExplorer<IContentProperty>(), new AttributeExplorer<IEditorContainer>());
            IItemNotifier notifier = mocks.DynamicMock<IItemNotifier>();
            mocks.Replay(notifier);
            definitions = new ContentTypeManager(builder, notifier);
            integrityManger = new IntegrityManager(definitions, parser, null, null);
            IntegrityEnforcer enforcer = new IntegrityEnforcer(persister, integrityManger);
            enforcer.Start();
        }