public void SetViaGenerics()
 {
     var instance = new DictionaryDataStoreAdapter(Dictionary);
     instance.Set<bool>(true);
     
     Assert.True(instance.Get<bool>());
 }
        public void WorkWithStringBasedKeys()
        {
            var instance = new DictionaryDataStoreAdapter(new Dictionary<string,object>());

            instance.Set<int>(5);

            Assert.Equal(5, instance.Get<int>());
        }
        public void GetViaGenericsWithKey()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);

            var result = instance.Get<int>("intKey");
            Assert.Equal(5, result);
            Assert.IsType<int>(result);
        }
        public void GetViaGenerics()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);

            var result = instance.Get<string>();
            Assert.Equal("TestString", result);
            Assert.IsType<string>(result);
        }
        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"));
        }
        public void GetViaKey()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);

            Assert.Equal(5, instance.Get("intKey"));
        }
        public void ConstructWithDictionary()
        {
            var instance = new DictionaryDataStoreAdapter(Dictionary);

            Assert.NotNull(instance);
        }
 public void NotContainItems()
 {
     var instance = new DictionaryDataStoreAdapter(Dictionary);
     Assert.False(instance.Contains("random string"));
 }
 public void ContainItems()
 {
     var instance = new DictionaryDataStoreAdapter(Dictionary);
     Assert.True(instance.Contains("intKey"));
 }
        public void ConstructWithNonGenericDictionary()
        {
            var dictionary = new Hashtable();
            var instance = new DictionaryDataStoreAdapter(dictionary);

            Assert.NotNull(instance);
        }