chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
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
asked by GopherCoder (1.7k points)

2 Answers

0 votes
Hi

The problem is that currently the Isolator does not support methods overloading. :(
We will add overload support in future release.
answered by ohad (35.4k points)
0 votes
Ok, thank you for the reply. Yesterday was my first day working with Isolater and the second test I tried to write and I was getting more and more frustrated with myself. I will take note of that behavior, keep an eye out for future releases and move on to other test writing and most likely a future of cluttering your forums with newbie questions.
answered by GopherCoder (1.7k points)
...