2020-03-10 20:53:04 +00:00
|
|
|
using Xunit;
|
|
|
|
|
2022-12-13 20:11:26 +00:00
|
|
|
namespace Tand.Core.Tests;
|
|
|
|
|
|
|
|
public class TandTests
|
2020-03-10 20:53:04 +00:00
|
|
|
{
|
|
|
|
|
2022-12-13 20:11:26 +00:00
|
|
|
[Fact]
|
|
|
|
public void GenerateTand()
|
|
|
|
{
|
|
|
|
var handleCallCounter = 0;
|
|
|
|
var resolver = new ResolverMock(new LogTarget<ITandSample>(tandSample => handleCallCounter++));
|
|
|
|
var tand = new Tand(resolver);
|
2020-03-10 20:53:04 +00:00
|
|
|
|
2022-12-13 20:11:26 +00:00
|
|
|
var sample = tand.DecorateWithTand<ITandSample, TandSample>(new TandSample());
|
|
|
|
var result = sample.LogMyParams("Hello, World", 42);
|
|
|
|
Assert.Equal(1, result);
|
|
|
|
Assert.Equal(2, handleCallCounter);
|
|
|
|
Assert.Equal(1, resolver.ResolvingCounter);
|
2020-03-10 20:53:04 +00:00
|
|
|
}
|
|
|
|
}
|