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

            Assert.AreSame(model, dc.GetValue("."));
            Assert.AreEqual(model, dc.GetValue("."));
        }
예제 #2
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"));
        }
예제 #3
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"));
        }
예제 #4
0
        public void DoesNotExistGivesNull()
        {
            var dc = new YateDataContext(new { foo = "bar" });

            Assert.AreEqual(null, dc.GetValue("yeahBUddy"));
        }
예제 #5
0
        public void DoesItWork()
        {
            var dc = new YateDataContext(new { foo = "bar" });

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