Using Moq and the native VS test framework. I'm trying to test a recursive function where values passed in:
public bool AuthenticateByDomain(string domainName, string password, string username, string email)
{
are used to find an entity:
// look for an existent domain name.
var matchFound = this.FindDomainPasswordMatch(domainName, password);
If found, look for existent UserName (the account already exists):
if (matchFound)
{
var account = this.GetByEmail(null, email);
if (account != null)
{
If not found, create the account based on the email and username provided:
var uAccount = this.CreateAccount(username, password, email, domainName);
and then recursively call itself where (presumably) the call to GetByEmail() is satisfied and the authenticating branch is invoked.
I've found a couple examples of Moq interacting with repository but haven't been able to see exactly how to approach my specific problem - testing that the repository gets updated and the recursion succeeds. I _am able to unit get each of the methods found in the top-level - do I declare that good enough and move on? Is this a persistence test?