How to make TextBox in wpf call OnLostFocus in unit test?

I have a custom component created in WPF using C #, where I check when the OnLostFocus text field is called (only when the user leaves the text field, can I check, because only then I have a complete input line to check).

How can I call OnLostFocus in a text box from unit test?

thank

+3
source share
1 answer

You do not quite understand how you conduct testing, but two things spring.

  • If you really want the text field to lose focus, set the focus to another control by calling someOtherControl.Focus ()
  • OnLostFocus, .
+3

Source: https://habr.com/ru/post/1765780/


All Articles