I am unit testing a method say ABC()
like
myclass target = new myclass();
target.ABC();
This ABC() method in turn calls another method XYZ() from a different class like anotherclass.XYZ()
and this XYZ() method's input parameter depends on values from textbox (s).
Since, at test run there is no values from textbox passed I am getting a null referrence exception while running the test (I mean test fails with exception).
Similar situation (another): method fetches id value from querystring like
HttpContext context
id = context.request.querystring["id"]
Since, at test run this id values is null I get a null referrence exception(I mean test fails with exception).
To my understanding, logically this is correct since this is test run and not actual run but still want to confirm once ...
Am I doing anything wrong?
OR
My test is functioning correct?
Please suggest. Appreciate your help.
Thanks.