public override void SetUp() {
            base.SetUp();
            var cache = new ImmutableInMemorySpecCache();
            ReflectorConfiguration.NoValidate = true;

            var reflectorConfiguration = new ReflectorConfiguration(new Type[] {}, new Type[] {}, new string[] {});
            facetFactory = new RemoveIgnoredMethodsFacetFactory(0);
            var menuFactory = new NullMenuFactory();
            var classStrategy = new DefaultClassStrategy(reflectorConfiguration);
            var metamodel = new Metamodel(classStrategy, cache);

            Reflector = new Reflector(classStrategy, metamodel, reflectorConfiguration, menuFactory, new IFacetDecorator[] {}, new IFacetFactory[] {facetFactory});
        }
コード例 #2
0
        protected override void RegisterTypes(IUnityContainer container) {
            base.RegisterTypes(container);
            // replace INakedObjectStore types
            var c = new EntityObjectStoreConfiguration();
            c.UsingCodeFirstContext(() => new TestContext("TestContext"));
            container.RegisterInstance<IEntityObjectStoreConfiguration>(c, (new ContainerControlledLifetimeManager()));

            var types = new[] {typeof (TestDomainObject[]), typeof (List<TestDomainObject>), typeof (ObjectQuery<TestDomainObject>), typeof (List<Int32>)};
            var ms = new[] {typeof (SimpleRepository<TestDomainObject>)};
            var ns = new[] {typeof (TestDomainObject).Namespace};
            var rc = new ReflectorConfiguration(types, ms, ns);
            container.RegisterInstance<IReflectorConfiguration>(rc, (new ContainerControlledLifetimeManager()));
        }