public void BindingCompiler_Valid_MethodCallOnValue() { var viewModel = new TestViewModel2 { MyProperty = 42 }; Assert.AreEqual(ExecuteBinding("13.ToString()", viewModel), "13"); }
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); }
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"); }