Ejemplo n.º 1
0
        public void SortedMapTest()
        {
            var client = new SessionNoServer(systemDir);

            client.BeginUpdate();
            var set = new SortedMap <string, object>();

            set.Add("test", "Test text for example.");
            set.Persist(client, set);
            client.Commit();
            client.BeginRead();
            var readSet = client.AllObjects <SortedMap <string, object> >(false, false).FirstOrDefault(rec => rec.Id == set.Id);

            Assert.IsNotNull(readSet);
            client.Commit();
        }
Ejemplo n.º 2
0
        public void SortedMapTest2()
        {
            const string key    = "test";
            const string value  = "Test text for example.";
            var          client = new SessionNoServer(systemDir);

            client.BeginUpdate();
            var originalRecord = new SortedMap <string, object>();

            originalRecord.Add(key, value);
            originalRecord.Persist(client, originalRecord);
            client.Commit();
            client.BeginRead();
            var newRecord = client.AllObjects <SortedMap <string, object> >(false, false).FirstOrDefault(r => r.Id == originalRecord.Id);

            Assert.IsNotNull(newRecord);
            Assert.AreEqual(originalRecord[key], newRecord[key]);
            client.Commit();
            client.Dispose();
        }