public void SetsIdOnMatchingProperty(SUT sut, IInvocation invocation, int barId)
        {
            var foo = new Foo { BarId = barId };
            var bar = new Bar();

            invocation.Method.Returns(foo.GetType().GetProperty("Bar").GetGetMethod());
            invocation.InvocationTarget.Returns(foo);
            invocation.ReturnValue = bar;

            sut.Intercept(invocation);

            bar.Id.Should().Be(barId);
        }
 public void ThrowsOnNullInvocation(SUT sut)
 {
     sut.Invoking(s => s.Intercept(null))
         .ShouldThrow<ArgumentNullException>();
 }
 public void SutIsInterceptor(SUT sut)
 {
     sut.Should().BeAssignableTo<IInterceptor>();
 }