コード例 #1
0
 public void TestGetGUID()
 {
     var testObj = new TestObj("This is a simple test hope shit does not go wrong!!", 666);
     var record = database.Save(testObj);
     Assert.IsTrue(Object.ReferenceEquals(testObj, record.Value), "IObjectDatabase.Save failed to return the same object that was passed to it in the returned record");
     record = database.Get<TestObj>(record.UniqueId);
     Assert.IsTrue(Object.ReferenceEquals(testObj, record.Value), "IObjectDatabase.Get(GUID) failed to return an object from memory");
     database.Dispose();
     database = new SQLiteObjectDatabase(databaseFile);
     var newRecord = database.Get<TestObj>(record.UniqueId);
     Assert.IsTrue(record.UniqueId == newRecord.UniqueId && testObj.Value1 == newRecord.Value.Value1 && testObj.Value2 == newRecord.Value.Value2, "IObjectDatabase.Get(GUID) failed to return an object from storage");
 }