Пример #1
0
        public void BindingCompiler_Valid_MethodCallOnValue()
        {
            var viewModel = new TestViewModel2 {
                MyProperty = 42
            };

            Assert.AreEqual(ExecuteBinding("13.ToString()", viewModel), "13");
        }
Пример #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);
        }
Пример #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");
        }