public void CheckAutoTransaction_NotDecoratedIsTransactional_WrappedInATransaction()
        {
            var interceptor = new TransactionInterceptor();
            var invocation = Substitute.For<IInvocation>();

            invocation.InvocationTarget.Returns(new AdministrationComponent());
            invocation.MethodInvocationTarget.Returns(typeof(AdministrationComponent).GetMethod("GetAllDrugs"));
            invocation.Method.Returns(typeof(AdministrationComponent).GetMethod("GetAllDrugs"));
            invocation.When(e => e.Proceed()).Do(e => Nothing());

            interceptor.Intercept(invocation);
            Assert.IsTrue(interceptor.WasTransactional);
        }
        public void CheckAutoTransaction_DecoratedIsNotTransactional_NotWrappedInATransaction()
        {
            var interceptor = new TransactionInterceptor();
            var invocation = Substitute.For<IInvocation>();

            invocation.InvocationTarget.Returns(new SqlComponent());
            invocation.MethodInvocationTarget.Returns(typeof(SqlComponent).GetMethod("ExecuteNonQuery"));
            invocation.Method.Returns(typeof(SqlComponent).GetMethod("ExecuteNonQuery"));
            invocation.When(e => e.Proceed()).Do(e => Nothing());

            interceptor.Intercept(invocation);
            Assert.IsFalse(interceptor.WasTransactional);
        }