tand/test/Tand.Core.Tests/ResolverMock.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

28 lines
No EOL
637 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Tand.Core.Api;
namespace Tand.Core.Tests
{
internal class ResolverMock : IDependencyResolver
{
private readonly IDictionary<Type, object> _targets;
internal ResolverMock(params object[] targets)
{
_targets = targets.ToDictionary(target => target.GetType(), target => target);
}
public ITandTarget<T> TargetOfType<T>(Type type)
{
ResolvingCounter++;
return (ITandTarget<T>)_targets[type];
}
internal int ResolvingCounter { get; private set; }
}
}