示例#1
0
        private TestCompany CreateTestCompany()
        {
            var restClient = new RestClient(BaseUrl);
            var request    = new RestRequest("/system/public/users/actions/create-test-company", Method.POST);

            return(RestUtil.AssertOk(restClient.Execute <TestCompany>(request)));
        }
示例#2
0
        protected string CreateTestChartFromJson(String json)
        {
            var restClient = new RestClient(BaseUrl);

            restClient.Authenticator = new HttpBasicAuthenticator(User.SecretKey, null);
            var chartKey = Guid.NewGuid().ToString();
            var request  = new RestRequest("/system/public/charts/{chartKey}", Method.POST)
                           .AddUrlSegment("chartKey", chartKey)
                           .AddParameter("application/json", json, ParameterType.RequestBody);

            RestUtil.AssertOk(restClient.Execute <object>(request));
            return(chartKey);
        }