dotnet user

dotnet user

  • NA
  • 2
  • 0

Object reference not set to an instance of an object.

Apr 6 2010 2:25 PM

When I'm writing a unit test for failed authentication, I'm getting an error like this: Object reference not set to an instance of an object.
Here's my code(pretty simple):
//validate with wrong username
The validation fails here(as expected) but I get the error: Object reference not set to an instance of an object.
ValidateUserResults validateUserTestFail = serviceClient.ValidateUser("newuser", "newPass1-i");
Assert.IsFalse(validateUserTestFail.Success, "Validate result should have been false");
// Authentication failed-wrong password
The validation fails here too(as expected) but I don't get the error.
ValidateUserResults validateUserTestFail1 = serviceClient.ValidateUser("newuser1", "123");
Assert.IsFalse(validateUserTestFail1.Success, "Validate result should have been true");
Can anybody please tell me why this is happening? I tried everything I can, but couldn't find a solution....
Thanks a lot in advance

Answers (1)