public void TestPackageLocation() { using (var db = new DbInstance("TestPackage", Windows.ApplicationModel.Package.Current.InstalledLocation)) { db.Map <MyData>().Automap(i => i.Id, true); db.Initialize(); db.Save(new MyData()); } }
public void TestPackageLocation() { try { using (var db = new DbInstance("TestPackage", Windows.ApplicationModel.Package.Current.InstalledLocation)) { db.Map <MyData>().Automap(i => i.Id, true); db.Initialize(); db.Save(new MyData()); } Assert.Fail("Must fail"); } catch (IOException) { } }
public void TestPKKey <T>(Expression <Func <MyDataKeys, T> > pkGetter, Action <MyDataKeys, T> pkSetter, T key) { var db = new DbInstance("DbKeys"); db.Map <MyDataKeys>().Key(pkGetter); db.Initialize(); var getter = pkGetter.Compile(); var obj1 = new MyDataKeys(); pkSetter(obj1, key); db.Save(obj1); var obj2 = db.LoadByKey <MyDataKeys>(key); Assert.AreEqual(getter(obj1), getter(obj2)); db.Purge(); }