2020-03-10 20:53:04 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2020-03-21 00:10:20 +00:00
|
|
|
using Tand.Core.Api;
|
2020-03-10 20:53:04 +00:00
|
|
|
|
|
|
|
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; }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|