public void ShouldDisposeSourcesAndPublishers() { IMessageSource <IRequest> requestSource = A.Fake <IMessageSource <IRequest> >(); IMessageSource <ICommand> commandSource = A.Fake <IMessageSource <ICommand> >(); IMessagePublisher <IEvent> eventPublisher = A.Fake <IMessagePublisher <IEvent> >(); IMessagePublisher <IResponse> responsePublisher = A.Fake <IMessagePublisher <IResponse> >(); IServiceEndpoint endpoint = new ServiceEndpoint(requestSource, commandSource, eventPublisher, responsePublisher, typeof(ITestServiceMessage1)); endpoint.Dispose(); A.CallTo(() => requestSource.Dispose()).MustHaveHappened(1, Times.Exactly); A.CallTo(() => commandSource.Dispose()).MustHaveHappened(1, Times.Exactly); A.CallTo(() => eventPublisher.Dispose()).MustHaveHappened(1, Times.Exactly); A.CallTo(() => responsePublisher.Dispose()).MustHaveHappened(1, Times.Exactly); }
public void Dispose() { _source.Dispose(); _converter.Dispose(); }