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); }
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(); }
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); }