public void SingleInterceptorCalled(IInterceptor interceptor, IInvocation invocation) { var sut = new CompositeInterceptor(interceptor); sut.Intercept(invocation); interceptor.Received().Intercept(invocation); }
public void InterceptorsCalledInOrder([Frozen] IInterceptor[] interceptors, CompositeInterceptor sut, IInvocation invocation) { var results = new List<IInterceptor>(); foreach (var i in interceptors) i.When(x => x.Intercept(invocation)).Do(_ => results.Add(i)); sut.Intercept(invocation); results.Should().Equal(interceptors); }
public void ThrowsOnNullInvocation(CompositeInterceptor sut) { sut.Invoking(s => s.Intercept(null)) .ShouldThrow<ArgumentNullException>(); }
public void SutIsInterceptor(CompositeInterceptor sut) { sut.Should().BeAssignableTo<IInterceptor>(); }