I have a Singleton class, something like this :
public class XConnector : IXConnector
{
private static readonly Lazy<XConnector> instance =
new Lazy<XConnector>(() => new XConnector());
public static XConnector Instance => instance.Value;
private XConnector()
{
}
public async Task<XConnector> GetData(XConnector con)
{
}
}
How can I mock this class with NSubstitute ?
in other hand : I want something like this
var target = Substitute.For<IXConnector>();
this is a quick Watch when I debug this code