public void SetUp() { _eventLogger = new EventLogger(); _eventContext = new EventContext(); _subServiceContext = TestUtilities.BuildSubServiceContextWithServices(new Dictionary <string, object> { { "IEventLogger", _eventLogger }, { "IEventContext", _eventContext } }); _eventContext.Build(); _eventContext.BindServiceContext(_subServiceContext, "IEventContext"); _eventContext.Initialize(); _eventContext.ResolveServiceBindings(); _subListener = Substitute.For <IListener>(); _eventContext.ContextBindEventListener(EventKey.Test, _subListener); _eventContext.ContextBindEventListener(EventKey.Test2, _subListener); }
public void SetUp() { _eventContext = new EventContext(); _subEventLogger = Substitute.For <IEventLogger>(); _subPayloadTypeLibrary = Substitute.For <IEventPayloadTypeLibrary>(); _subListener1 = Substitute.For <IListener>(); _subListener2 = Substitute.For <IListener>(); _subServiceContext = TestUtilities.BuildSubServiceContextWithServices(new Dictionary <string, object> { { "IEventLogger", _subEventLogger }, { "IEventPayloadTypeLibrary", _subPayloadTypeLibrary } }); _subPayloadTypeLibrary.ValidatePayload(Arg.Any <EventPayload>()).Returns(true); _eventContext.BindServiceContext(_subServiceContext); _eventContext.Build(); _eventContext.ResolveServiceBindings(); _eventContext.Initialize(); }