Hello All,
I am trying code up my first set of test against a legacy system and I'm a bit confused with the Arrange/Assert/Act syntax.
I have two methods -overloaded
public void ResetPwd(newPwd){
//forward call
ResetPwd(null, newPwd);
}
public void ResetPwd(oldPwd, newPwd){
sql database stuff;
}
These are void methods so I wanted to call the first's original code and not my mock's version but just verify the second version was called without calling the original stuff and getting the sql object clutter.
Keep in mind, there is actually static calls in the first for authentication and param verification, which I have figured out how to test already. And these communicate with callers via exceptions. Ie. There are SecurityExceptions thrown from the first version if the static check fails and similar in the second version, successful changes are emails.
Isolate.WhenCalled only has CallOriginal, which I figure I use on the first method, but the second method I can't figure out.
I don't want to call the original, I don't want to ignore it because I wanted to use Isolate.Verify that it was called, and I don't want it throwing an exception, so I could not figure how to 'arrange' this method.
At this point I don't have anything for the two param version and I see an error about get_connstring, which tells me it has entered it's method body and is trying to connect.
Can anyone help guild me in the right direction?
Thanks,
Code Gohper