/// <summary>
 ///     Creates a new instance of the execution context holder. Will throw a StartupException if an instance
 ///     has already been created.
 /// </summary>
 protected NakedObjectsContext() {
     // TODO remove next line once XAT test framework is updated
     Reset();
     if (singleton != null) {
         throw new InvalidStateException("Naked Objects Singleton already set up");
     }
     singleton = this;
 }
Пример #2
0
        public void Init() {
            nakedObjects = StaticContext.CreateInstance();

            nakedObjects.SetReflector(reflector);
            nakedObjects.SetObjectPersistor(Persistor);
            nakedObjects.SetSession(new TestProxySession());

            NakedObjectsContext.Reflector.Init();
            NakedObjectsContext.ObjectPersistor.Init();
        }
 /// <summary>
 ///     Resets the singleton, so another can created.
 /// </summary>
 public static void Reset() {
     singleton = null;
 }