private void pictureBox1_MouseHover(object sender, EventArgs e) { //给组成员显示提示 if (null != Hint) { Hint.Invoke(this); } }
private void pictureBox1_MouseLeave(object sender, EventArgs e) { //停止组成员显示提示 if (null != Hint) { Hint.Invoke(null); } }
public void WhenHintInvoked_TheViewModelIsUpdated(string key, string value) { var values = new Dictionary <string, string>() { { key, value } }; var component = new Hint(); component.ViewComponentContext = ViewComponentTestHelper.GetViewComponentContext(); ViewViewComponentResult result = component.Invoke(values) as ViewViewComponentResult; HintModel resultModel = (HintModel)result.ViewData.Model; //Assert value.Should().Be(ViewComponentTestHelper.GetPropertyValue(resultModel, key)); }