Example #1
0
        public void WorkWithStringBasedKeys()
        {
            var instance = new DictionaryDataStoreAdapter(new Dictionary <string, object>());

            instance.Set <int>(5);

            Assert.Equal(5, instance.Get <int>());
        }
Example #2
0
        public void SetViaGenerics()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);

            instance.Set <bool>(true);

            Assert.True(instance.Get <bool>());
        }
Example #3
0
        public void SetViaKey()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);
            var random   = new { Some = "Test", Data = 5 };

            instance.Set("random", random);

            Assert.Equal(random, instance.Get("random"));
        }