public void Interception_MethodWithOneArgument_PrintsArgumentValue()
        {
            MethodInterception t = new MethodInterception();
            t.Method1( "Test" );

            string output = OutputString.ToString();
            StringAssert.Contains( "MethodInterception.Method1(string arg = \"Test\")", output );
        }
示例#2
0
        public void Interception_MethodWithOneArgument_PrintsArgumentValue()
        {
            MethodInterception t = new MethodInterception();

            t.Method1("Test");

            string output = OutputString.ToString();

            StringAssert.Contains("MethodInterception.Method1(string arg = \"Test\")", output);
        }
        public void Interception_LastArgumentIsTheResult_LogsReturnValue()
        {
            MethodInterception t = new MethodInterception();
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append( "Test" );

            t.Method6( "Test", new object(), 3, DateTime.Now, DateTime.Now.AddYears( 1 ), stringBuilder );

            string output = OutputString.ToString();
            StringAssert.Contains( "Leaving: PostSharp.Toolkit.Tests.MethodInterception.Method6() : {Test}", output );
        }
示例#4
0
        public void Interception_LastArgumentIsTheResult_LogsReturnValue()
        {
            MethodInterception t             = new MethodInterception();
            StringBuilder      stringBuilder = new StringBuilder();

            stringBuilder.Append("Test");

            t.Method6("Test", new object(), 3, DateTime.Now, DateTime.Now.AddYears(1), stringBuilder);

            string output = OutputString.ToString();

            StringAssert.Contains("Leaving: PostSharp.Toolkit.Tests.MethodInterception.Method6() : {Test}", output);
        }