Hello,
Recently I have started using Testing Framework to test WPF applications (MVVM). Maybe it's the novice's problem but i can't generate RoutedEventArgs on my_button.User.Click(); Operations like TypeText() or Click() should be treated like a normal user actions, aren't they?
I am trying something like this:
_wpfWindow.Find.ByName(UI_Components.Button_LogIn).User.Click();
or
_wpfWindow.Find.ByName(UI_Components.TextBox_Name).User.TypeText(login, 1, 5, true);
During click on LogIn Button (by real mouse) is activating method, by Click() option not. The same problem I have with generating events for KeyPress:
private void OnKeyDownPressed(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
runXXX();
}
private void OnLoginButtonClick(object sender, RoutedEventArgs e)
{
runXXX();
}
How can i fix it or generate KeyEventArgs or RoutedEventArgs. Btw. I couldn't change the code from this both methods, necessary condition.
Greetings.