本文整理汇总了C#中Subscriber.WaitMessages方法的典型用法代码示例。如果您正苦于以下问题:C# Subscriber.WaitMessages方法的具体用法?C# Subscriber.WaitMessages怎么用?C# Subscriber.WaitMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber.WaitMessages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnChanged_TriggersEvent_UpdatesData
public void OnChanged_TriggersEvent_UpdatesData()
{
var subscriber = new Subscriber<CharacterDirectoriesChanged>(Fixture.WurmApiManager.InternalEventAggregator);
var batman = ClientMock.AddPlayer("Batman");
subscriber.WaitMessages(1);
// verifying event sent
Expect(subscriber.ReceivedMessages.Count(), GreaterThan(0));
// verifying data updated
var allChars = System.GetAllCharacters().ToList();
var allDirFullPaths = System.AllDirectoriesFullPaths.ToList();
var allDirNames = System.AllDirectoryNamesNormalized.ToList();
Expect(allChars, Member(new CharacterName(batman.Name)).And.Count.EqualTo(1));
Expect(allDirFullPaths, Member(batman.PlayerDir.FullName).And.Count.EqualTo(1));
Expect(allDirNames, Member(batman.PlayerDir.Name.ToUpperInvariant()).And.Count.EqualTo(1));
}
示例2: TriggersOnChanged
public void TriggersOnChanged()
{
var subscriber = new Subscriber<ConfigDirectoriesChanged>(Fixture.WurmApiManager.InternalEventAggregator);
var batman = ClientMock.AddConfig("batmobile");
subscriber.WaitMessages(1);
// verifying event sent
Expect(subscriber.ReceivedMessages.Count(), GreaterThan(0));
// verifying data updated
var allConfigs = System.AllConfigNames.ToList();
var allDirFullPaths = System.AllDirectoriesFullPaths.ToList();
var allDirNames = System.AllDirectoryNamesNormalized.ToList();
Expect(allConfigs, Member(batman.NameNormalized).And.Count.EqualTo(1));
Expect(allDirFullPaths, Member(batman.ConfigDir.FullName).And.Count.EqualTo(1));
Expect(allDirNames, Member(batman.ConfigDir.Name.ToUpperInvariant()).And.Count.EqualTo(1));
}