31 lines
758 B
C#
31 lines
758 B
C#
using System;
|
|
|
|
namespace VisualStudioMock
|
|
{
|
|
static class Ext
|
|
{
|
|
public static void Log(string message)
|
|
{
|
|
Console.WriteLine("Mock: " + message);
|
|
}
|
|
|
|
public static void LogCall(string @class, string method, string message = null)
|
|
{
|
|
Console.WriteLine("Mock call: " + @class + "!" + method + " " + message);
|
|
}
|
|
|
|
public static void LogEnter(string @class, string method)
|
|
{
|
|
Console.WriteLine("Mock enter: " + @class + "!" + method);
|
|
}
|
|
|
|
public static void LogExit(string @class, string method)
|
|
{
|
|
Console.WriteLine("Mock exit: " + @class + "!" + method);
|
|
}
|
|
|
|
public static U ComBarrier<T, U>(this T instance) where T : U {
|
|
return (U)(new ComProxy(instance).GetIUnknown());
|
|
}
|
|
}
|
|
} |