Example #1
0
 public TestProxyNakedObject CreateAdapterForTransient(object associate) {
     var testProxyNakedObject = new TestProxyNakedObject();
     testProxyNakedObject.SetupObject(associate);
     testProxyNakedObject.SetupSpecification(GetSpecification(associate.GetType()));
     testProxyNakedObject.ResolveState.Handle(Events.InitializeTransientEvent);
     testProxyNakedObject.SetupOid(new TestProxyOid(nextId++));
     return testProxyNakedObject;
 }
        public override void SetUp() {
            base.SetUp();

            // system
            dataManager = new MockDataManager();
            string xmlDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\NakedObjects\xml";

            objectStore = new XmlObjectStore(dataManager, new DummyServiceManager(), xmlDirectory);
            objectStore.Clock = (new TestClock());

            // objects
            spec = new TestProxySpecification(typeof (string));
            spec.SetupFields(new INakedObjectAssociation[0]);
            nakedObject = new TestProxyNakedObject();
            nakedObject.SetupSpecification(spec);
            nakedObject.OptimisticLock = (new SerialNumberVersion(23, null, null));
        }
Example #3
0
 public void MakePersistent(TestProxyNakedObject adapter) {
     IOid oid = adapter.Oid;
     Persistor.ConvertTransientToPersistentOid(oid);
     adapter.SetupOid(oid);
     Persistor.MakePersistent(adapter);
 }