public void InvalidUserIdInputTests(InvalidUserId condition)
        {
            var propDic = new List <KeyValuePair <string, object> >();

            if (condition == InvalidUserId.ReverseKeyValue)
            {
                propDic.Add(new KeyValuePair <string, object>("1234", InvalidUserIdMapper[condition]));
            }
            else if (condition == InvalidUserId.WrongKey)
            {
                propDic.Add(new KeyValuePair <string, object>("USERID", InvalidUserIdMapper[condition]));
            }
            else if (condition == InvalidUserId.WithoutKeyValue)
            {
                propDic.Add(new KeyValuePair <string, object>("", InvalidUserIdMapper[condition]));
            }
            else
            {
                propDic.Add(new KeyValuePair <string, object>("userId", InvalidUserIdMapper[condition]));
            }

            var userHandler = new UserManager("UnlockUser");
            var result      = userHandler.Execute <UnlockUserResponse>(propDic, System.Net.Http.HttpMethod.Post);

            PerformTest(result);
        }
Beispiel #2
0
        public void TestInvalidHeaderForcePasswordChange(InvalidUserId invalidUserId)
        {
            var request = new Dictionary <string, object>();

            InvalidUserIdMapper[invalidUserId](request);
            var handler  = new ForcePasswordChangeManager();
            var response = handler.ForcePasswordChangeDiffHeader <object>(request, System.Net.Http.HttpMethod.Post);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest), $"Request force password change api with header {invalidUserId} successfully.");
        }
Beispiel #3
0
        public void TestInvalidBodyForcePasswordChange(InvalidUserId invalidUserId)
        {
            var request = new Dictionary <string, object>();

            InvalidUserIdMapper[invalidUserId](request);
            var header = new Dictionary <string, object>()
            {
                ["userId"] = TestContext.CurrentContext.Test.Properties.Get("adminUser2Login").ToString(),
            };
            var handler  = new ForcePasswordChangeManager();
            var response = handler.ForcePasswordChangeDiffHeaderWithContent <object>(header, request, System.Net.Http.HttpMethod.Post);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest), $"request force password change api with body {invalidUserId} successfully.");
        }