public void TransformSucceedsWithExtraMap()
		{
			FastExpando o = new FastExpando();

			FastExpando other = o.Transform(new Dictionary<string, string>() { { "A", "Z" } });
			IDictionary<string, object> otherDict = other;

			Assert.AreNotSame(o, other);
			Assert.IsFalse(otherDict.ContainsKey("A"));
			Assert.IsFalse(otherDict.ContainsKey("Z"));
		}
Ejemplo n.º 2
0
        public void TransformSucceedsWithExtraMap()
        {
            FastExpando o = new FastExpando();

            FastExpando other = o.Transform(new Dictionary <string, string>()
            {
                { "A", "Z" }
            });
            IDictionary <string, object> otherDict = other;

            Assert.AreNotSame(o, other);
            Assert.IsFalse(otherDict.ContainsKey("A"));
            Assert.IsFalse(otherDict.ContainsKey("Z"));
        }
		public void TransformShouldCreateANewObject()
		{
			FastExpando o = new FastExpando();
			dynamic d = o;
			d["A"] = "foo";
			d["B"] = "goo";

			FastExpando other = o.Transform(new Dictionary<string, string>() { { "A", "Z" } });
			IDictionary<string, object> otherDict = other;
			dynamic otherD = other;

			Assert.AreNotSame(o, other);
			Assert.IsFalse(otherDict.ContainsKey("A"));
			Assert.IsNotNull(otherD["B"]);
			Assert.AreEqual(otherD["Z"], d["A"]);
		}
Ejemplo n.º 4
0
        public void TransformShouldCreateANewObject()
        {
            FastExpando o = new FastExpando();
            dynamic     d = o;

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

            FastExpando other = o.Transform(new Dictionary <string, string>()
            {
                { "A", "Z" }
            });
            IDictionary <string, object> otherDict = other;
            dynamic otherD = other;

            Assert.AreNotSame(o, other);
            Assert.IsFalse(otherDict.ContainsKey("A"));
            Assert.IsNotNull(otherD["B"]);
            Assert.AreEqual(otherD["Z"], d["A"]);
        }