本文整理汇总了C#中Codeer.Friendly.Async类的典型用法代码示例。如果您正苦于以下问题:C# Async类的具体用法?C# Async怎么用?C# Async使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Async类属于Codeer.Friendly命名空间,在下文中一共展示了Async类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:25,代码来源:WPFButtonBaseTest.cs
示例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();
}
开发者ID:Codeer-Software,项目名称:Friendly.MultiRow.Win,代码行数:8,代码来源:TestBase.cs
示例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);
}
开发者ID:Codeer-Software,项目名称:HandsOn14-3,代码行数:8,代码来源:SearchFormDriver.cs
示例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");
}
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:9,代码来源:XamDockManagerTest.cs
示例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);
}
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:9,代码来源:XamOutlookBarTest.cs
示例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();
}
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:9,代码来源:XamRibbonTest.cs
示例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();
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:9,代码来源:WPFMenuItemTest.cs
示例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();
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:9,代码来源:WPFTreeViewItemTest.cs
示例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);
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:10,代码来源:WPFToggleButtonTest.cs
示例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);
}
开发者ID:Codeer-Software,项目名称:Friendly.C1.Win,代码行数:10,代码来源:FlexGridTest.cs
示例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);
}
开发者ID:Codeer-Software,项目名称:HandsOn14-3,代码行数:10,代码来源:AddFormDriver.cs
示例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;
}
开发者ID:Codeer-Software,项目名称:HandsOn14-3,代码行数:10,代码来源:AddFormDriver.cs
示例15: ArgumentNullException
public FriendlyOperation this[string staticOperation, Async async]
{
get
{
if (async == null)
{
throw new ArgumentNullException("async");
}
return CreateFullNameFriendlyOperation(staticOperation, null, async);
}
}
开发者ID:Codeer-Software,项目名称:Friendly,代码行数:11,代码来源:AppFriend.cs
示例16: SelectedIndexAsync
public void SelectedIndexAsync()
{
app.Type<WPFListBoxTest>().AddSelectionEvent(listBox.AppVar);
Async async = new Async();
WindowControl main = WindowControl.FromZTop(app);
listBox.EmulateChangeSelectedIndex(3, async);
new NativeMessageBox(main.WaitForNextModal()).EmulateButtonClick("OK");
async.WaitForCompletion();
int index = listBox.SelectedIndex;
Assert.AreEqual(3, index);
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFListBoxTest.cs
示例17: TestEmulateChangeValueAsync
public void TestEmulateChangeValueAsync()
{
var slider = new WPFSlider(_target);
_app[GetType(), "ChangeValueEvent"](slider.AppVar);
var async = new Async();
slider.EmulateChangeValue(TestValue, async);
new NativeMessageBox(_mainWindow.WaitForNextModal()).EmulateButtonClick("OK");
async.WaitForCompletion();
Assert.AreEqual(TestValue, slider.Value);
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:11,代码来源:WPFSliderTest.cs
示例18: CloseAll
/// <summary>
/// すべて閉じる
/// </summary>
/// <param name="testDlg">ダイアログ</param>
/// <param name="async">きっかけとなった非同期処理</param>
/// <returns>閉じたダイアログの個数</returns>
internal static int CloseAll(WindowControl testDlg, Async async)
{
for (int i = 0; true; i++)
{
WindowControl msg = testDlg.WaitForNextModal(async);
if (msg == null)
{
return i;
}
new NativeMessageBox(msg).EmulateButtonClick("OK");
}
}
开发者ID:Codeer-Software,项目名称:Friendly.Windows.NativeStandardControls,代码行数:18,代码来源:MessageBoxUtility.cs
示例19: GetItemEmulateChangeSelectedAsync
public void GetItemEmulateChangeSelectedAsync()
{
var listView = new WPFListView(_ctrl.listView);
WindowControl windowControl = WindowControl.FromZTop(_app);
var item = listView.GetItem(99);
_app.Type(GetType()).MessageBoxEvent(item);
var a = new Async();
item.EmulateChangeSelected(true, a);
Assert.IsTrue(item.IsSelected);
new NativeMessageBox(windowControl.WaitForNextModal()).EmulateButtonClick("OK");
a.WaitForCompletion();
}
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:12,代码来源:WPFListViewTest.cs
示例20: TestInitialize
public void TestInitialize()
{
_app = new WindowsAppFriend(Process.Start(Target.Path));
var main = WindowControl.FromZTop(_app);
var a = new Async();
new WPFButtonBase(main.Dynamic()._buttonXamEditors).EmulateClick(a);
_dlg = main.WaitForNextModal();
_combo = new XamComboEditorDriver(_dlg.Dynamic()._combo);
_numeric = new XamValueEditorDriver(_dlg.Dynamic()._numeric);
_dateTime = new XamValueEditorDriver(_dlg.Dynamic()._dateTime);
_currency = new XamValueEditorDriver(_dlg.Dynamic()._currency);
_masked = new XamValueEditorDriver(_dlg.Dynamic()._masked);
_text = new XamValueEditorDriver(_dlg.Dynamic()._text);
}
开发者ID:Codeer-Software,项目名称:Friendly.XamControls,代码行数:14,代码来源:XamEditorsTest.cs
注:本文中的Codeer.Friendly.Async类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论