Your expectation is wrong. You have determined that in GetResponse you expect an empty string as a parameter, but you pass the value SSO_URL. Thus, expectation does not occur, and a value is returned instead.
You have two options to fix this.
One way is to set IgnoreArguments () while waiting
target.Expect(t => t.GetResponse("")).IgnoreArguments().Return(authResponse);
and the other way is to pass in your SSO_URL as a parameter to the GetResponse method like this
target.Expect(t => t.GetResponse("http://localhost")).Return(authResponse);
Jehof source
share