本文整理汇总了C#中EventAggregator.HandlerExistsFor方法的典型用法代码示例。如果您正苦于以下问题:C# EventAggregator.HandlerExistsFor方法的具体用法?C# EventAggregator.HandlerExistsFor怎么用?C# EventAggregator.HandlerExistsFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventAggregator
的用法示例。
在下文中一共展示了EventAggregator.HandlerExistsFor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: A_valid_subscriber_is_assigned_as_a_handler_its_message_type
public void A_valid_subscriber_is_assigned_as_a_handler_its_message_type() {
var handlerStub = new Mock<IHandle<object>>().Object;
var aggregator = new EventAggregator();
Assert.False(aggregator.HandlerExistsFor(typeof (object)));
aggregator.Subscribe(handlerStub);
Assert.True(aggregator.HandlerExistsFor(typeof (object)));
}
示例2: A_valid_subscriber_gets_removed_from_the_handler_list
public void A_valid_subscriber_gets_removed_from_the_handler_list() {
var eventAggregator = new EventAggregator();
var handlerMock = new Mock<IHandle<object>>();
eventAggregator.Subscribe(handlerMock.Object);
Assert.True(eventAggregator.HandlerExistsFor(typeof (object)));
eventAggregator.Unsubscribe(handlerMock.Object);
Assert.False(eventAggregator.HandlerExistsFor(typeof (object)));
}
示例3: True_returned_when_a_handler_exists_for_a_given_message
public void True_returned_when_a_handler_exists_for_a_given_message() {
var handlerStub = new Mock<IHandle<object>>().Object;
var aggregator = new EventAggregator();
aggregator.Subscribe(handlerStub);
Assert.True(aggregator.HandlerExistsFor(typeof (object)));
}