public void InvalidSpecialTests(InvalidSpecial condition) { var userHandler = new UserManager("UnlockUser"); var propDic = new Dictionary <string, object>(); InvalidSpecialMapper[condition](propDic); var connection = PrivateApiConnection.GetConnectionForCurrentTest(); if (condition == InvalidSpecial.ExistedIdWithUserRole) { Login(connection, NormalUserIds[0].Company.Name, NormalUserIds[0].Login, NormalUserIds[0].Password); } else if (condition == InvalidSpecial.AlreadyUnlocked) { userHandler.Execute <UnlockUserResponse>(propDic, System.Net.Http.HttpMethod.Post); } else if (condition == InvalidSpecial.ErrorConnectDb) { connection.DeAuthenticate(); } var result = userHandler.Execute <UnlockUserResponse>(propDic, System.Net.Http.HttpMethod.Post); PerformTest(result, condition.ToString()); }
public void InvalidSpecialTests(Params param, InvalidSpecials value) { var request = CreateDefaultRequest().ToList(); var key = param.ToString().ToLower(); var index = request.IndexOf(request.Where(x => x.Key == key).Single()); InvalidSpecialMapper[value](request, key, index); PerformErrorTest(request, HttpMethod.GET); }