I am new with using Moq and having some logical Problems atm.
I've a class with two Methods an in that Class Method One Calls Method two like:
public class TestClass
{
public virtual string FindUser(string user)
{
//do some Stuff
string check = UserCheck("some string to check");
//do some stuff
return "some other userstring";
}
protected virtual string UserCheck(string blubb)
{
//do some other stuff
return "some string";
}
}
sometimes I swap out some Functionality to other Functions to encapsulate some Functionality in the same class.
I don't know how to Unit test this with Moq, because I need to Moq my own class what I am testing. I've found this as an "solution",
but thats no Solution for me (I think) because, I try to encapsulate some Functionality in just an other Function. Is that wrong what I am doing or did I have to create a new class everytime to encapsulate one Function?