public void ClickWithEventCallback() { // setup var button = new MockButton(); bool clicked = false; // test button.Clicked = callbackFactory.Create(this, () => { clicked = true; }); button.Click(); // validate Assert.True(clicked); }
public void ClickWithCommand() { // setup var button = new MockButton(); string result = null; button.Command = new TestCommand(p => result = p); button.CommandParameter = "foo"; // test button.Click(); // validate Assert.NotNull(result); Assert.Equal("foo", result); }
public async Task ClickWithCommand() { // setup var button = new MockButton(); string result = null; button.Command = new TestCommand(p => result = p); button.CommandParameter = new TestCommandParameter { Message = "foo" }; // test await button.Click(); // validate Assert.NotNull(result); Assert.Equal("foo", result); }