示例#1
0
        public void TestIdGeneratorCanBeSupplied()
        {
            var query = new QueryPersistance();

            PersistanceStore = new TypeBasedPersistance(new TestStoreSelector(query), new TestGenerator());
            var toSave = new PersistedString();

            PersistanceStore.Save(toSave);
            Assert.AreEqual("123", toSave.Id);
        }
示例#2
0
        public void TestQueryingQueriableStoreProxies()
        {
            var query = new QueryPersistance();

            PersistanceStore = new TypeBasedPersistance(new TestStoreSelector(query));
            var queriable = (TypeBasedPersistance)PersistanceStore;

            Assert.IsFalse(query.Queried);
            queriable.Query <PersistedString>(new[] { QueryElement.FieldEquals("id", "1") });
            Assert.IsTrue(query.Queried);
        }
示例#3
0
 public void SetUp()
 {
     PersistanceStore = new TypeBasedPersistance(new TestStoreSelector(new MemoryPersistance()));
 }