public void MutateSucceedsWithExtraMap()
		{
			FastExpando o = new FastExpando();
			dynamic d = o;
			d["B"] = "goo";

			o.Mutate(new Dictionary<string, string>() { { "A", "Z" } });
			IDictionary<string, object> dict = o;

			Assert.IsFalse(dict.ContainsKey("A"));
			Assert.IsTrue(dict.ContainsKey("B"));
		}
		public void MutateShouldModifyObject()
		{
			FastExpando o = new FastExpando();
			dynamic d = o;
			d["A"] = "foo";
			d["B"] = "goo";

			o.Mutate(new Dictionary<string, string>() { { "A", "Z" } });
			IDictionary<string, object> dict = o;

			Assert.IsFalse(dict.ContainsKey("A"));
			Assert.IsNotNull(d["B"]);
			Assert.AreEqual(d["Z"], "foo");
		}
Exemplo n.º 3
0
        public void MutateSucceedsWithExtraMap()
        {
            FastExpando o = new FastExpando();
            dynamic     d = o;

            d["B"] = "goo";

            o.Mutate(new Dictionary <string, string>()
            {
                { "A", "Z" }
            });
            IDictionary <string, object> dict = o;

            Assert.IsFalse(dict.ContainsKey("A"));
            Assert.IsTrue(dict.ContainsKey("B"));
        }
Exemplo n.º 4
0
        public void MutateShouldModifyObject()
        {
            FastExpando o = new FastExpando();
            dynamic     d = o;

            d["A"] = "foo";
            d["B"] = "goo";

            o.Mutate(new Dictionary <string, string>()
            {
                { "A", "Z" }
            });
            IDictionary <string, object> dict = o;

            Assert.IsFalse(dict.ContainsKey("A"));
            Assert.IsNotNull(d["B"]);
            Assert.AreEqual(d["Z"], "foo");
        }