tand/test/Tand.Core.Tests/LogTarget.cs
Peter Kurfer d8d307545f
Refactored
- Added Benchmarks
- Added Nuke build
- Refactored directory structure
- Generated GitHub Actions config from Nuke
- Added tool to handle benchmarking from Nuke
2020-03-21 01:10:20 +01:00

26 lines
No EOL
608 B
C#

using System;
using Tand.Core.Api;
using Tand.Core.Models;
namespace Tand.Core.Tests
{
public class LogTarget<T> : ITandTarget<T>
{
private readonly Action<T> _instanceHandle;
public LogTarget(Action<T> instanceHandle)
{
_instanceHandle = instanceHandle;
}
public void OnEnterMethod(CallEnterContext<T> enterContext)
{
_instanceHandle(enterContext.Instance);
}
public void OnLeaveMethod(CallLeaveContext<T> callLeaveContext)
{
_instanceHandle(callLeaveContext.Instance);
}
}
}