コード例 #1
0
 public void UseDataContextIfSourceNotSpecified_Test02() {
     var source = new FCBObject();
     Window.DataContext = source;
     FCBButton wce = new FCBButton();
     Window.Content = wce;
     PrepareBehavior("Command", "Operation2", null, null, null, false);
     Interaction.GetBehaviors(wce).Add(Behavior);
     Assert.IsNotNull(wce.Command);
 }
コード例 #2
0
        public void UseDataContextIfSourceNotSpecified_Test03()
        {
            var       source = new FCBObject();
            FCBButton wce    = new FCBButton();

            wce.DataContext = source;
            Window.Content  = wce;
            PrepareBehavior("Command", "Operation2", null, null, null, false);
            Interaction.GetBehaviors(wce).Add(Behavior);
            Assert.IsNotNull(wce.Command);
        }
コード例 #3
0
        public void UseMethodDefaultParamsIfCommandParameterEmpty_Test01()
        {
            var       source = new FCBObject();
            FCBButton wce    = new FCBButton();

            wce.DataContext = source;
            Window.Content  = wce;
            PrepareBehavior("Command", "Operation5", null, null, null, false);
            Interaction.GetBehaviors(wce).Add(Behavior);
            Assert.IsNull(source.CanExecuteResult);
            Assert.IsTrue(Button.IsEnabled);
            Assert.IsNull(Button.CommandParameter);
            wce.Command.Execute(null);
            Assert.AreEqual("7", source.ExecuteResult);
        }
コード例 #4
0
 public void UseMethodDefaultParamsIfCommandParameterEmpty_Test01() {
     var source = new FCBObject();
     FCBButton wce = new FCBButton();
     wce.DataContext = source;
     Window.Content = wce;
     PrepareBehavior("Command", "Operation5", null, null, null, false);
     Interaction.GetBehaviors(wce).Add(Behavior);
     Assert.IsNull(source.CanExecuteResult);
     Assert.IsTrue(Button.IsEnabled);
     Assert.IsNull(Button.CommandParameter);
     wce.Command.Execute(null);
     Assert.AreEqual("7", source.ExecuteResult);
 }