Esempio n. 1
0
        public virtual void SetUp() {
            var reflector = new DotNetReflector {
                ClassStrategy = new DefaultClassStrategy(),
                FacetDecorator = new FacetDecoratorSet()
            };


            NakedObjectsContext context = StaticContext.CreateInstance();
            context.SetReflector(reflector);
            context.SetObjectPersistor(new TestProxyPersistor());


            reflector.Init();

            specification = LoadSpecification(reflector);
            specification.PopulateAssociatedActions(new INakedObject[]{});
        }
Esempio n. 2
0
        public INakedObjectReflector CreateReflector() {
            var reflector = new DotNetReflector();
            var facetDecoratorSet = new FacetDecoratorSet();
            reflector.FacetDecorator = facetDecoratorSet;
            if (enhancements.Count == 0) {
                Log.Debug("No enhancements set up");
            }
            else {
                AddEnhancement(facetDecoratorSet);
            }

            reflector.Init();

            if (OptionalByDefault) {
                ((FacetFactorySetImpl) reflector.IntrospectionControlParameters.FacetFactorySet).ReplaceAndRegisterFactory(typeof (MandatoryDefaultFacetFactory), new OptionalDefaultFacetFactory());
            }

            return reflector;
        }
Esempio n. 3
0
 public override void SetUp() {
     base.SetUp();
     var dnReflector = new DotNetReflector {FacetDecorator = new FacetDecoratorSet()};
     dnReflector.Init();
     facetFactory = new RemoveEventHandlerMethodsFacetFactory {Reflector = dnReflector};
 }
Esempio n. 4
0
 protected override DotNetSpecification LoadSpecification(DotNetReflector reflector) {
     return (DotNetSpecification)reflector.LoadSpecification(typeof(TestPojo[]));
 }
Esempio n. 5
0
 protected override DotNetSpecification LoadSpecification(DotNetReflector reflector) {
     return (DotNetSpecification)reflector.LoadSpecification(typeof(ArrayList));
 }
Esempio n. 6
0
 protected override DotNetSpecification LoadSpecification(DotNetReflector reflector) {
     return (DotNetSpecification)reflector.LoadSpecification(typeof(TestDomainObject));
 }
Esempio n. 7
0
 protected abstract DotNetSpecification LoadSpecification(DotNetReflector reflector);
Esempio n. 8
0
 public override void SetUp() {
     base.SetUp();
     var dnReflector = new DotNetReflector {FacetDecorator = new FacetDecoratorSet()};
     dnReflector.Init();
     facetFactory = new UnsupportedParameterTypesMethodFilteringFactory {Reflector = dnReflector};
 }
Esempio n. 9
0
 public DotNetSpecification(Type type, DotNetReflector reflector) {
     introspector = new DotNetIntrospector(type, this, reflector);
     identifier = new IdentifierImpl(type.FullName);
 }