Exemplo n.º 1
0
        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." });
        }
Exemplo n.º 2
0
        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));
        }