如何使用TestStack.White管理UserControls的事件?

时间:2018-03-09 17:00:59

标签: c# wpf white devexpress-wpf teststack

我正在测试我的wpf应用程序,我需要验证某些用户控件事件是否正确引发或不相似,例如,已加载/已卸载事件。 我已经创建了我的UserControl类(我正在使用DevExpress WPF控件),因为我知道TestStack.White不支持本机第三方控件,代码如下:

[ControlTypeMapping(CustomUIItemType.Custom, WindowsFramework.Wpf)]
    public class UserControl : CustomUIItem
    {
        public UserControl(
            AutomationElement automationElement, 
            ActionListener actionListener)
            : base(automationElement, actionListener)
        {            
        }

        protected UserControl()
        {            
        }

        public event RoutedEventHandler Loaded;

        public event RoutedEventHandler Unloaded;
    }

但现在我不明白如何验证事件的提升与否。有人帮我吗?感谢

0 个答案:

没有答案