public void GetInvalidUserFieldCases(UserTypes userType, InvalidCases value) { var request = GenerateDefaultRequest(); request["User.P_Id"] = UserCreator.Data[userType].ToString(); InvalidCaseMapper[value](request, "fields"); var userHandler = new UserManager(); var result = userHandler.Execute <User>(request, string.Empty, HttpMethod.Get); PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest)); }
public void GetInvalidUserIdCases(InvalidCases value) { var request = GenerateDefaultRequest(); InvalidCaseMapper[value](request, "User.P_Id"); var userHandler = new UserManager(); var result = userHandler.Execute <User>(request, string.Empty, HttpMethod.Get); PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest)); var expectedErrorCode = VerifyErrorCodeMapper[value]; if (expectedErrorCode != 0) { PrAssert.That(result.Errors.Code, PrIs.EqualTo(expectedErrorCode)); } }