本文整理匯總了C#中System.App.SetupAsyncActions方法的典型用法代碼示例。如果您正苦於以下問題:C# App.SetupAsyncActions方法的具體用法?C# App.SetupAsyncActions怎麽用?C# App.SetupAsyncActions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.App
的用法示例。
在下文中一共展示了App.SetupAsyncActions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetUp
public void SetUp()
{
nav = Substitute.For<INavigator>();
nav.PushAsync<ViewModel>().Returns(Task.Delay(0));
serviceAPI = Substitute.For<IServiceAPI>();
serviceAPI.AuthUser("john", "secret")
.Returns(Task.FromResult(new UserInfo { Username = "John", HomeCity = "Reykjavik" }));
serviceAPI.AuthUser("john", "sdf")
.Returns(Task.FromResult(UserInfo.NotFound));
serviceAPI.AuthUser("john", "oh-noes")
.Throws(new NullReferenceException());
serviceAPI.GetDevices().Returns(Task.FromResult(new List<DeviceInfo>()));
app = new App();
app.SetupAsyncActions(nav, serviceAPI);
store = app.Store;
store.Middleware(history.logger());
}