本文整理汇总了C#中Session.ScrapbookAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Session.ScrapbookAsync方法的具体用法?C# Session.ScrapbookAsync怎么用?C# Session.ScrapbookAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session.ScrapbookAsync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrapbookAsync103Of1700Items
public async Task ScrapbookAsync103Of1700Items()
{
// Arrange
var sut = new Session(serverUri => new TestRequestSource());
await sut.LoginAsync(TestConstants.ValidUsername,
TestConstants.ValidPasswordHash,
TestConstants.ValidServerUri);
// Act
var results = await sut.ScrapbookAsync();
// Assert
results.Count(i => i.HasItem).Should().Be(103);
}
示例2: ScrapbookAsyncHas36Of252MonsterItems
public async Task ScrapbookAsyncHas36Of252MonsterItems()
{
// Arrange
var sut = new Session(serverUri => new TestRequestSource());
await sut.LoginAsync(TestConstants.ValidUsername,
TestConstants.ValidPasswordHash,
TestConstants.ValidServerUri);
// Act
var results = (await sut.ScrapbookAsync()).ToList();
// Assert
results.OfType<IMonsterItem>().Count(i => i.HasItem).Should().Be(36);
}
示例3: ScrapbookAsyncReturns348ScoutItems
public async Task ScrapbookAsyncReturns348ScoutItems()
{
// Arrange
var sut = new Session(serverUri => new TestRequestSource());
await sut.LoginAsync(TestConstants.ValidUsername,
TestConstants.ValidPasswordHash,
TestConstants.ValidServerUri);
// Act
var results = await sut.ScrapbookAsync();
// Assert
results.OfType<IScoutItem>().Count().Should().Be(348);
}
示例4: ScrapbookAsyncThrowsExceptionIfSessionIsLoggedIn
public void ScrapbookAsyncThrowsExceptionIfSessionIsLoggedIn()
{
// Arrange
var sut = new Session(serverUri => new TestRequestSource());
Func<Task> a = async () => await sut.ScrapbookAsync();
// Act / Assert
a.ShouldThrow<SessionLoggedOutException>()
.Where(e => e.Message == "ScrapbookAsync requires to be logged in.");
}