public void SaveAndQueryTest() { Database db = new SQLiteDatabase(nameof(SaveAndQueryTest)); db.TryEnsureSchema <DaoReferenceObject>(); DaoReferenceObject referenceObject = new DaoReferenceObject() { IntProperty = 10, DecimalProperty = 10, LongProperty = 10, ULongProperty = 10, DateTimeProperty = Instant.Now, BoolProperty = true, ByteArrayProperty = "This is the byte array property".ToBytes(), StringProperty = "This is the string property" }; referenceObject.Id.ShouldBeNull("Id should have been null"); referenceObject.Save(db); string referenceJson = referenceObject.ToJsonSafe().ToJson(); referenceObject.Id.ShouldNotBeNull("Id should not have been null"); DaoReferenceObject retrievedById = DaoReferenceObject.OneWhere(c => c.Id == referenceObject.Id, db); retrievedById.ShouldNotBeNull("failed to retrieve object by id"); Expect.AreEqual(retrievedById.ULongProperty, referenceObject.ULongProperty); Expect.AreEqual(referenceObject, retrievedById); Expect.AreEqual(referenceJson, retrievedById.ToJsonSafe().ToJson()); Message.PrintLine(db.ConnectionString); }