public override void TestSetUp()
        {
            var serializer = new ServiceStackSerialiser();

            _frameworkContext = new FakeFrameworkContext(serializer);
            _configuration = new IndexConfiguration(GetPathForTest());
            var controller = new IndexController(_configuration, _frameworkContext);

            CacheProvider = new CacheProvider(controller, false);
        }
Example #2
0
        public void Setup()
        {
            _nhibernateTestSetup = new NhibernateTestSetupHelper();

            var storageProvider = new IoHiveTestSetupHelper(_nhibernateTestSetup.FakeFrameworkContext);

            Hive = new HiveManager(
                    new[]
                        {
                            new ProviderMappingGroup(
                                "test",
                                new WildcardUriMatch("content://"),
                                _nhibernateTestSetup.ReadonlyProviderSetup,
                                _nhibernateTestSetup.ProviderSetup,
                                _nhibernateTestSetup.FakeFrameworkContext),
                            storageProvider.CreateGroup("uploader", "storage://file-uploader"),
                        },
                    _nhibernateTestSetup.FakeFrameworkContext);

            var appContext = new FakeUmbracoApplicationContext(Hive, false);

            var resolverContext = new MockedMapResolverContext(_nhibernateTestSetup.FakeFrameworkContext, Hive, new MockedPropertyEditorFactory(appContext), new MockedParameterEditorFactory());
            var webmModelMapper = new CmsModelMapper(resolverContext);
            var renderModelMapper = new RenderTypesModelMapper(resolverContext);

            _nhibernateTestSetup.FakeFrameworkContext.SetTypeMappers(new FakeTypeMapperCollection(new AbstractMappingEngine[] { webmModelMapper, renderModelMapper, new FrameworkModelMapper(_nhibernateTestSetup.FakeFrameworkContext) }));

            var membersMembershipProvider = new MembersMembershipProvider { AppContext = appContext };
            membersMembershipProvider.Initialize("MembersMembershipProvider", new NameValueCollection());
            MembershipService = new MembershipService<Member, MemberProfile>(appContext.FrameworkContext, Hive,
                "security://member-profiles", "security://member-groups", Framework.Security.Model.FixedHiveIds.MemberProfileVirtualRoot,
                membersMembershipProvider, Enumerable.Empty<MembershipProviderElement>());

            PublicAccessService = new PublicAccessService(Hive, MembershipService, appContext.FrameworkContext);

            var serializer = new ServiceStackSerialiser();
            SerializationService = new SerializationService(serializer);
        }
 public override void SetUp()
 {
     var serializer = new ServiceStackSerialiser();
     SerializationService = new SerializationService(serializer);
 }