public static void AddNakedObjects(this NakedCoreOptions coreOptions, Action <NakedObjectsOptions> setupAction) { var options = new NakedObjectsOptions(); setupAction(options); options.RegisterCustomTypes?.Invoke(coreOptions.Services); coreOptions.Services.RegisterFacetFactories <IObjectFacetFactoryProcessor>(ObjectFacetFactories.StandardFacetFactories()); coreOptions.Services.AddSingleton <ObjectFacetFactorySet, ObjectFacetFactorySet>(); coreOptions.Services.AddSingleton <ObjectClassStrategy, ObjectClassStrategy>(); coreOptions.Services.AddSingleton <SystemTypeFacetFactorySet, SystemTypeFacetFactorySet>(); coreOptions.Services.AddSingleton <SystemTypeClassStrategy, SystemTypeClassStrategy>(); coreOptions.Services.AddSingleton <IReflector, SystemTypeReflector>(); coreOptions.Services.AddSingleton <IReflector, ObjectReflector>(); coreOptions.Services.AddSingleton <IObjectReflectorConfiguration>(p => ObjectReflectorConfig(options)); }
protected IFacetFactoryOrder <T> GetOrder <T>() => new TestFacetFactoryOrder <T>(ObjectFacetFactories.StandardFacetFactories());
private IFacetFactory NewFacetFactory <T>() where T : IFacetFactory => (T)Activator.CreateInstance(typeof(T), new TestFacetFactoryOrder <T>(ObjectFacetFactories.StandardFacetFactories()), MockLoggerFactory);