Ejemplo n.º 1
0
        public void BindingCompiler_Valid_MethodCallOnValue()
        {
            var viewModel = new TestViewModel2 {
                MyProperty = 42
            };

            Assert.AreEqual(ExecuteBinding("13.ToString()", viewModel), "13");
        }
Ejemplo n.º 2
0
        public void BindingCompiler_Valid_CollectionCount()
        {
            var viewModel = new TestViewModel2()
            {
                Collection = new List <Something>()
                {
                    new Something {
                        Value = true
                    }
                }
            };

            Assert.AreEqual(ExecuteBinding("Collection.Count > 0", viewModel), true);
        }
Ejemplo n.º 3
0
        public void BindingCompiler_Valid_CollectionIndex()
        {
            var viewModel = new TestViewModel2()
            {
                Collection = new List <Something>()
                {
                    new Something {
                        Value = true
                    }
                }
            };

            Assert.AreEqual(ExecuteBinding("Collection[0].Value ? 'a' : 'b'", viewModel), "a");
        }