Ejemplo n.º 1
0
        public void WriteInvocation <TTarget>(MethodInfo methodInfo, InvocationResult invocationResult, object[] arguments)
            where TTarget : class
        {
            var invocationRecord = new InvocationEntry(typeof(TTarget), methodInfo, arguments, invocationResult, DateTimeOffset.UtcNow);
            var serializedRecord = _serializer.Serialize(invocationRecord);

            _echoWriter.WriteSerializedInvocation(serializedRecord);
        }
Ejemplo n.º 2
0
 public void WriteInvocation <TTarget>(MethodInfo methodInfo, InvocationResult invocationResult, object[] arguments)
     where TTarget : class
 {
     Console.WriteLine($"Intercepting {typeof(TTarget).Name}.{methodInfo.Name} method:");
     foreach (var argument in arguments)
     {
         Console.WriteLine($"\tArgument {argument?.GetType()}: {argument}");
     }
     Console.WriteLine($"\tReturn {invocationResult?.GetResultType()}: {invocationResult}");
 }