public void Test_we_can_set_a_value_and_click_a_button() { _automationPeerSample = new AutomationPeerSample(); TestPanel.Children.Add(_automationPeerSample); var textBoxPeer = new TextBoxAutomationPeer(_automationPeerSample.txtPhotoUrl); var valueProvider = (IValueProvider)textBoxPeer; var buttonPeer = new ButtonAutomationPeer(_automationPeerSample.cmdAdd); var buttonInvoker = (IInvokeProvider)buttonPeer; EnqueueCallback(() => valueProvider.SetValue("http://farm4.static.flickr.com/3085/3092376392_dc1aaf9eb6.jpg")); EnqueueConditional(buttonPeer.IsEnabled); EnqueueCallback(buttonInvoker.Invoke); EnqueueTestComplete(); }
public void Test_we_can_set_a_value_and_click_a_button() { _automationPeerSample = new AutomationPeerSample(); TestPanel.Children.Add(_automationPeerSample); var textBoxPeer = new TextBoxAutomationPeer(_automationPeerSample.txtPhotoUrl); var valueProvider = (IValueProvider)textBoxPeer; var buttonPeer = new ButtonAutomationPeer(_automationPeerSample.cmdAdd); var buttonInvoker = (IInvokeProvider)buttonPeer; EnqueueCallback(() => valueProvider.SetValue("http://farm4.static.flickr.com/3085/3092376392_dc1aaf9eb6.jpg")); EnqueueConditional(buttonPeer.IsEnabled); EnqueueCallback(buttonInvoker.Invoke); EnqueueTestComplete(); }