I followed this SO answer to a similar question, (the below is an implentation of the 2nd answer)
I'm trying to figure out how to test:
public async Task<string> DoWork()
{
return await _testRepository.GetAsync(); <-- how do I test here???
}
Example Class
using System.Threading.Tasks;
using Test.DataAccess.Core;
using Test.DataAccess.Repository;
namespace Test.DataAccess
{
public class TestManager : ITestManager
{
private IUnitOfWork _unitOfWork;
private ITestRepository _testRepository;
public TestManager(IUnitOfWork unitOfWork)
{
_unitOfWork = unitOfWork;
_testRepository = _unitOfWork.GetRepository<TestRepository>();
}
public async Task<string> DoWork()
{
return await _testRepository.GetAsync();
}
}
}
Example Repo Link: