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); }
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); }
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); }