Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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);
 }