Esempio n. 1
0
        public void CannotSaveAnUnversionedTaskOverAVersionedOne()
        {
            var otherSession = pieDatabase.OpenSession();
            var otherTask = new Task() {Description = "shoes"};

            otherSession.Store(otherTask, "sometask"); //...and saves it

            Assert.Throws<ConcurrencyException>(otherSession.Commit);
        }
Esempio n. 2
0
        public void SetUp()
        {
            var store = new FileTransactionStore(Path.GetRandomFileName());
            pieDatabase = new PieDatabase(store);
            var session = pieDatabase.OpenSession();
            var task = new Task()
            {
                Description = "milk",
            };

            session.Store(task, "task");
            session.Commit();
        }
Esempio n. 3
0
        public void PreservesReferences()
        {
            var user = new User() { Name = "Harry" };
            var task = new Task() { Creator = user, Assignee = user };
            var dbSession = _database.OpenSession();
            dbSession.Store(task, "asdfg");

            var loadedTask = dbSession.Get<Task>("asdfg");

            Assert.True(loadedTask.Assignee == loadedTask.Creator);
        }