Beispiel #1
0
 public void DatabaseCanBeOpened()
 {
     using (IWAYDDatasource _db = CurrentDb())
     {
         Assert.IsTrue(_db.Root != null);
     }
 }
Beispiel #2
0
        public void ReturnsAllEntries()
        {
            using (IWAYDDatasource _db = CurrentDb())
            {
                _db.Save(new Entry());
                _db.Save(new Entry());
                _db.Save(new Entry());

                Assert.AreEqual(3, _db.GetAllEntries().Count());
            }
        }
Beispiel #3
0
 public void CanRetreiveEntry()
 {
     using (IWAYDDatasource _db = CurrentDb())
     {
         long initsize = _db.UsedSize;
         var  entry    = new Entry();
         _db.storeObject(entry);
         IPersistent persistedEntry = _db.GetObjectByOid(entry.Oid);
         Assert.AreEqual(persistedEntry, entry);
     }
 }
Beispiel #4
0
 public void CanInsertEntry()
 {
     using (IWAYDDatasource _db = CurrentDb())
     {
         long initsize = _db.UsedSize;
         var  entry    = new Entry();
         _db.storeObject(entry);
         long size = _db.UsedSize;
         Assert.IsTrue(size > initsize);
     }
 }
Beispiel #5
0
 public Context(IDataSourceFactory datasourceFactory, IModelFactory modelFactory)
 {
     _datasource   = datasourceFactory.GetCurrent();
     _modelFactory = modelFactory;
 }