Exemple #1
0
        public void SetTest <T>(string key, T value)
        {
            var atom = new DictionaryAtom();

            atom.Set(key, value);

            atom.ContainsKey(key).Should().BeTrue();
        }
Exemple #2
0
        public void ContainsKeyTest()
        {
            const string key   = "test";
            const int    value = 5000;

            var atom = new DictionaryAtom();

            atom.Set(key, value);

            atom.ContainsKey(key).Should().BeTrue();
        }
Exemple #3
0
        public void SetListAtom()
        {
            var listAtom = new ListAtom {
                "1 2 3 4 5"
            };

            var atom = new DictionaryAtom();

            atom.Set("TestList", listAtom);

            atom.ContainsKey("TestList").Should().BeTrue();

            var foundAtom = atom.GetAtom <ListAtom>("TestList");

            foundAtom.Should().NotBeNull();
            foundAtom.Should().BeAssignableTo <ListAtom>();
            foundAtom.GetString(0).Should().Be("1 2 3 4 5");
        }
Exemple #4
0
        public void SetDictionaryAtom()
        {
            var setAtom = new DictionaryAtom();

            setAtom.Set("Test", "1 2 3 4 5");

            var atom = new DictionaryAtom();

            atom.Set("TestDictionary", setAtom);

            atom.ContainsKey("TestDictionary").Should().BeTrue();

            var foundAtom = atom.GetAtom <DictionaryAtom>("TestDictionary");

            foundAtom.Should().NotBeNull();
            foundAtom.Should().BeAssignableTo <DictionaryAtom>();
            foundAtom.ContainsKey("Test").Should().BeTrue();
        }