Пример #1
0
        private ApiResponse<object> SettingsPageSetToken(string invalidToken, TestCoreFramework.Enums.HttpMethod httpMethod)
        {
            using (var coreConnection = new AuthApiConnection
            {
                SuppressAuthentication = true
            })
            {
                coreConnection.RegisterAuthHeader(invalidToken);

                if (httpMethod != TestCoreFramework.Enums.HttpMethod.GET)
                {
                    return new DefaultManager(coreConnection).Send(new SettingSetRequest
                    {
                        AllowedRolePwdLogin = 2,
                        ComnanyId = Convert.ToInt32(AuthenticationInfoProvider.Current.DefaultPartition),
                        LoginUrl = "http://test.com/",
                        SsoEnabled = true
                    }, additionalSettings: new DefaultManager.AdditionalRequestSettings
                    {
                        Endpoint = CommonConstants.SettingUIUrl,
                        UrlParameters = new Dictionary<string, string> { ["companyId"] =  AuthenticationInfoProvider.Current.DefaultPartition },
                        HttpMethod = httpMethod
                    });
                }
                return new DefaultManager(coreConnection).Send(CommonConstants.SettingUIUrl, new Dictionary<string, string> { ["companyId"] = AuthenticationInfoProvider.Current.DefaultPartition }, TestCoreFramework.Enums.HttpMethod.GET);
            }
        }
Пример #2
0
 public async Task <ApiResponse <object> > SendAsync(string endpoint, string content, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json")
 {
     return(ProcessResponseWithContent <object>(await Connection.SendAsync(endpoint, content, _httpMethodMap[httpMethod], contentType)));
 }
Пример #3
0
 public ApiResponse <object> Send(string endpoint, IEnumerable <KeyValuePair <string, string> > parameters, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json")
 {
     return(SendAsync(endpoint, parameters, httpMethod, contentType).Result);
 }
Пример #4
0
 public async Task <ApiResponse <object> > SendAsync(string endpoint, IEnumerable <KeyValuePair <string, string> > parameters, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json")
 {
     return(ProcessResponseWithContent <object>(await Connection.SendAsync(endpoint, parameters, _httpMethodMap[httpMethod], contentType)));
 }
Пример #5
0
 public ApiResponse <T> Send <T>(string endpoint, string content, TestCoreFramework.Enums.HttpMethod httpMethod, string contentType = "application/json")
 {
     return(SendAsync <T>(endpoint, content, httpMethod, contentType).Result);
 }