本文整理汇总了C#中Codeer.Friendly.Async类的典型用法代码示例。如果您正苦于以下问题:C# Async类的具体用法?C# Async怎么用?C# Async使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Async类属于Codeer.Friendly命名空间,在下文中一共展示了Async类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ButtonClickAsyncTest
public void ButtonClickAsyncTest()
{
// Arrenge
dynamic main = _app.Type<Application>().Current.MainWindow;
AppVar buttonCore = _app.Type<Button>()();
main._grid.Children.Add(buttonCore);
dynamic checker = _app.Type<ButtonEventCheck>()(buttonCore, true);
WindowControl windowControl = WindowControl.FromZTop(_app);
WPFButtonBase ButtonBase = new WPFButtonBase(buttonCore);
// Act
Async async = new Async();
ButtonBase.EmulateClick(async);
// Assert
WindowControl messageBoxControl = windowControl.WaitForNextModal();
NativeMessageBox messageBox = new NativeMessageBox(messageBoxControl);
Assert.AreEqual("TestMessageWindow", messageBox.Message);
Assert.IsTrue((bool)checker.ButtonClickCalled);
// Teardown
messageBox.EmulateButtonClick("OK");
messageBoxControl.WaitForDestroy();
async.WaitForCompletion();
}
示例2: TestCellActivateAsync
public void TestCellActivateAsync()
{
var async = new Async();
_grid.Rows[ 0 ].Cells[ 1 ].EmulateActivate( async );
async.WaitForCompletion();
_grid.Rows[ 0 ].Cells[ 1 ].IsActive.IsTrue();
}
示例3: SearchFormDriver
public SearchFormDriver(WindowControl window, Async async)
{
Async = async;
Window = window;
ButtonExecute = new FormsButton(Window.Dynamic()._buttonExecute);
TextBoxSearch = new FormsTextBox(Window.Dynamic()._textBoxSearch);
ListBoxEmployee = new FormsListBox(Window.Dynamic()._listBoxEmployee);
}
示例4: TestActivateAsync
public void TestActivateAsync()
{
var panes = _dock.GetPanes();
panes[0].EmulateActivate();
var async = new Async();
panes[1].EmulateActivate(async);
async.WaitForCompletion();
_dock.ActivePane.HeaderText.Is("Pane2");
}
示例5: TestInitialize
public void TestInitialize()
{
_app = new WindowsAppFriend(Process.Start(Target.Path));
var main = WindowControl.FromZTop(_app);
var a = new Async();
new WPFButtonBase(main.Dynamic()._buttonXamOutlookBar).EmulateClick(a);
_dlg = main.WaitForNextModal();
_outlook = new XamOutlookBarDriver(_dlg.Dynamic()._outlook);
}
示例6: TestEmulateClickAsync
public void TestEmulateClickAsync()
{
var item = _ribbon.ApplicationMenu.GetItem("b", "b-1", "b-1-1");
((bool)_dlg.Dynamic().b_1_1_clicked).IsFalse();
Async a = new Async();
item.EmulateClick(a);
a.WaitForCompletion();
((bool)_dlg.Dynamic().b_1_1_clicked).IsTrue();
}
示例7: EmulteClickTestAsync
public void EmulteClickTestAsync()
{
WPFMenuItem item = new WPFMenuItem(_ctrl._menuItemMessage);
Async async = new Async();
WindowControl windowControl = WindowControl.FromZTop(_app);
item.EmulateClick(async);
new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
async.WaitForCompletion();
}
示例8: EmulteChangeSelectedAsyncTest
public void EmulteChangeSelectedAsyncTest()
{
WPFTreeViewItem item = new WPFTreeViewItem(_ctrl._item1);
Async async = new Async();
WindowControl windowControl = WindowControl.FromZTop(_app);
item.EmulateChangeSelected(true, async);
new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
async.WaitForCompletion();
}
示例9: TestNative
public void TestNative()
{
Async async = new Async();
app[GetType(), "MessageBoxA", async](0, "Message", "Title", 0);
NativeMessageBox msg = new NativeMessageBox(WindowControl.WaitForIdentifyFromWindowText(app, "Title"));
Assert.AreEqual("Title", msg.Title);
Assert.AreEqual("Message", msg.Message);
msg.EmulateButtonClick("OK");
async.WaitForCompletion();
}
开发者ID:Codeer-Software,项目名称:Friendly.Windows.NativeStandardControls,代码行数:10,代码来源:NativeMessageBoxTest.cs
示例10: TestEmulateCheckAsync
public void TestEmulateCheckAsync()
{
_app.Type<WPFToggleButtonTest>().AddToggleEvent(_toggle.AppVar);
Async async = new Async();
WindowControl main = WindowControl.FromZTop(_app);
_toggle.EmulateCheck(true, async);
new NativeMessageBox(main.WaitForNextModal()).EmulateButtonClick("OK");
async.WaitForCompletion();
Assert.IsTrue((bool)_toggle.IsChecked);
}
示例11: TestInitialize
public void TestInitialize()
{
_app = new WindowsAppFriend(Process.Start(Target.Path));
var main = WindowControl.FromZTop(_app);
var a = new Async();
new FormsButton(main.Dynamic()._buttonFlexGrid).EmulateClick(a);
_dlg = main.WaitForNextModal();
_grid = new C1FlexGridDriver(_dlg.Dynamic()._grid);
}
示例12: TestNet
public void TestNet()
{
Async async = new Async();
app[typeof(MessageBox), "Show", async]("Message", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
NativeMessageBox msg = new NativeMessageBox(main.WaitForNextModal());
Assert.AreEqual("Title", msg.Title);
Assert.AreEqual("Message", msg.Message);
msg.EmulateButtonClick("OK");
async.WaitForCompletion();
}
开发者ID:Codeer-Software,项目名称:Friendly.Windows.NativeStandardControls,代码行数:10,代码来源:NativeMessageBoxTest.cs
示例13: AddFormDriver
public AddFormDriver(WindowControl window, Async async)
{
Window = window;
Async = async;
ButtonEntry = new FormsButton(Window.Dynamic()._buttonEntry);
TextBoxName = new FormsTextBox(Window.Dynamic()._textBoxName);
TextBoxAddress = new FormsTextBox(Window.Dynamic()._textBoxAddress);
RadioButtonWoman = new FormsRadioButton(Window.Dynamic()._radioButtonWoman);
RadioButtonMan = new FormsRadioButton(Window.Dynamic()._radioButtonMan);
}
示例14: ButtonEntry_EmulateClickAndGetMessage
public string ButtonEntry_EmulateClickAndGetMessage()
{
Async async = new Async();
ButtonEntry.EmulateClick(async);
var msgBox = new NativeMessageBox(Window.WaitForNextModal());
var msg = msgBox.Message;
msgBox.EmulateButtonClick("OK");
async.WaitForCompletion();
return msg;
}
示例15: ArgumentNullException
public FriendlyOperation this[string staticOperation, Async async]
{
get
{
if (async == null)
{
throw new ArgumentNullException("async");
}
return CreateFullNameFriendlyOperation(staticOperation, null, async);
}
}