예제 #1
0
        public void CanPushValuesAndGetBothObjectsValues()
        {
            var dc = new YateDataContext(new { foo = "bar" });

            dc.PushValue(new { hello = "world" });

            Assert.AreEqual("bar", dc.GetValue("foo"));
            Assert.AreEqual("world", dc.GetValue("hello"));
        }
예제 #2
0
        public void PopingRemovesModels()
        {
            var dc = new YateDataContext(new { foo = "bar" });

            dc.PushValue(new { hello = "world" });

            Assert.AreEqual("bar", dc.GetValue("foo"));
            Assert.AreEqual("world", dc.GetValue("hello"));

            dc.PopValue();

            Assert.AreEqual("bar", dc.GetValue("foo"));
            Assert.AreEqual(null, dc.GetValue("hello"));
        }