public void Handle_ShouldCallEveryHandlers() { var handler = new TextFilter(new[] { handler1.Object, handler2.Object }); var result = handler.ExcludeWords(new[] { "1", "2", "2", "2", "2", "2" }); result.ShouldBeEquivalentTo(new [] { "1.", "2.", "2.", "2.", "2." }); }
public void Handle_ShouldCallHandlersOnlyOneTimes() { var handler = new TextFilter(new[] { handler1.Object, handler2.Object }); handler.ExcludeWords(new[] { "1", "2", "2", "2", "2", "2" }); handler1.Verify(a => a.ExcludeWords(It.IsAny <string[]>()), Times.Exactly(1)); handler2.Verify(a => a.ExcludeWords(It.IsAny <string[]>()), Times.Exactly(1)); }