Ejemplo n.º 1
0
        public async Task TestJsonConsumer()
        {
            var memoryStore = new OdinMemoryStore();
            var jsonConsumer = new JsonSerializer.OdinJsonSerializer<Foo>(memoryStore);

            var foo = new Foo { Bar = "Baz" };
            await jsonConsumer.Put("foo", foo);

            Assert.IsNotNull(await memoryStore.Get("foo"));
            Assert.AreEqual("Baz", (await jsonConsumer.Get("foo")).Bar);

            Assert.AreEqual("Baz", (await jsonConsumer.Search()).First().Value.Bar);
        }
Ejemplo n.º 2
0
        public async Task TestJsonConsumer()
        {
            var memoryStore  = new OdinMemoryStore();
            var jsonConsumer = new JsonSerializer.OdinJsonSerializer <Foo>(memoryStore);

            var foo = new Foo {
                Bar = "Baz"
            };
            await jsonConsumer.Put("foo", foo);

            Assert.IsNotNull(await memoryStore.Get("foo"));
            Assert.AreEqual("Baz", (await jsonConsumer.Get("foo")).Bar);

            Assert.AreEqual("Baz", (await jsonConsumer.Search()).First().Value.Bar);
        }