public void ViewModelBase_GetCommandE_Test8() { var vm = new MockViewModel(); var commandInvoked = false; var cmd1 = vm.InvokeGetCommandE("Test", x => commandInvoked = true, x => false); var cmd2 = vm.InvokeGetCommandE("Test", x => commandInvoked = true, x => false); var cmd3 = vm.Test; Assert.AreSame(cmd1, cmd2); Assert.AreSame(cmd1, cmd3); Assert.IsFalse(commandInvoked); }
public void ViewModelBase_GetCommandE_Test7() { var vm = new MockViewModel(); var commandInvoked = false; var cmd = vm.InvokeGetCommandE("Test", x => commandInvoked = true, x => false); var commandAssert = new CommandEventAssert(cmd); cmd.OnCanExecuteChanged(); commandAssert.Expect(); Assert.IsFalse(commandInvoked); }
public void ViewModelBase_GetCommandE_Test2() { var vm = new MockViewModel(); try { vm.InvokeGetCommandE("", x => { }, x => false); Assert.Fail("Expected an exception"); } catch (ArgumentException ex) { Assert.AreEqual("propertyName", ex.ParamName); } }
public void ViewModelBase_GetCommandE_Test4() { var vm = new MockViewModel(); try { vm.InvokeGetCommandE("Test", null, x => false); Assert.Fail("Expected an exception"); } catch (ArgumentNullException ex) { Assert.AreEqual("command", ex.ParamName); } }
public void ViewModelBase_GetCommandE_Test1() { var vm = new MockViewModel(); var commandInvoked = false; var cmd = vm.InvokeGetCommandE("Test", x => commandInvoked = true, x => false); Assert.IsFalse(commandInvoked); Assert.IsFalse(cmd.CanExecute(0)); Assert.IsFalse(commandInvoked); cmd.Execute(0); Assert.IsTrue(commandInvoked); }