本文整理汇总了C#中Emitter.Listeners方法的典型用法代码示例。如果您正苦于以下问题:C# Emitter.Listeners方法的具体用法?C# Emitter.Listeners怎么用?C# Emitter.Listeners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emitter
的用法示例。
在下文中一共展示了Emitter.Listeners方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListenersWithoutHandlers
public void ListenersWithoutHandlers()
{
var emitter = new Emitter();
var expected = new IListener[] {};
//Assert.AreEqual(expected, emitter.Listeners("foo").ToArray());
Assert.AreEqual(expected.Count(), emitter.Listeners("foo").ToArray().Count());
CollectionAssert.AreEqual(expected, emitter.Listeners("foo").ToArray());
}
示例2: Listeners
public void Listeners()
{
var log = LogManager.GetLogger(Global.CallerName());
log.Info("Start");
var emitter = new Emitter();
var calls = new List<object>();
var listener3 = new TestListener3(calls);
emitter.On("foo", listener3);
var expected = new IListener[] {listener3};
Assert.AreEqual(expected.Count(), emitter.Listeners("foo").ToArray().Count());
CollectionAssert.AreEqual(expected, emitter.Listeners("foo").ToArray());
}
示例3: Listeners
public void Listeners()
{
LogManager.SetupLogManager();
var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
log.Info("Start");
var emitter = new Emitter();
var calls = new List<object>();
var listener3 = new TestListener3(calls);
emitter.On("foo", listener3);
var expected = new IListener[] {listener3};
Assert.AreEqual(expected.Count(), emitter.Listeners("foo").ToArray().Count());
CollectionAssert.AreEqual(expected, emitter.Listeners("foo").ToArray());
}
示例4: ListenersWithoutHandlers
public void ListenersWithoutHandlers()
{
LogManager.SetupLogManager();
var emitter = new Emitter();
var expected = new IListener[] {};
Assert.Equal(expected, emitter.Listeners("foo").ToArray());
}