Esempio n. 1
0
 public ApiClient()
 {
     QuestionsService = new QuestionsClient("https://localhost:44353/", httpClient);
     QuizService      = new QuizClient("https://localhost:44353/", httpClient);
     StudentService   = new StudentsClient("https://localhost:44353/", httpClient);
     GradesService    = new GradesClient("https://localhost:44353/", httpClient);
 }
Esempio n. 2
0
        public void Setup()
        {
            _httpClient      = new HttpClient();
            _usersClient     = new UsersClient(_httpClient);
            _testsClient     = new TestsClient(_httpClient);
            _questionsClient = new QuestionsClient(_httpClient);
            _sut             = new AnswersClient(_httpClient);

            _user = GetRandomUser();
            _usersClient.RegisterUserAsync(_user).GetAwaiter().GetResult();
            _testId = _testsClient.AddAsync().GetAwaiter().GetResult().Deserialize <Guid>();

            for (var i = 0; i < 10; i++)
            {
                _questionsClient.AddAsync(_testId).GetAwaiter().GetResult();
            }

            _questions = _questionsClient.GetListAsync(_testId).GetAwaiter().GetResult().Deserialize <List <QuestionDto> >();
            foreach (var question in _questions)
            {
                question.Question = GetRandomString();
                question.Answer   = GetRandomString();
                _questionsClient.UpdateAsync(question).GetAwaiter().GetResult();
            }
        }
Esempio n. 3
0
        public void Setup()
        {
            _httpClient  = new HttpClient();
            _usersClient = new UsersClient(_httpClient);
            _testsClient = new TestsClient(_httpClient);
            _sut         = new QuestionsClient(_httpClient);

            _user = GetRandomUser();
            _usersClient.RegisterUserAsync(_user).GetAwaiter().GetResult();
            _testId = _testsClient.AddAsync().GetAwaiter().GetResult().Deserialize <Guid>();
        }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="clientId"></param>
 /// <param name="clientSecret"></param>
 public VoiqClient(string clientId, string clientSecret, Environments environment)
 {
     BaseUrl       = GetBaseUrl(environment);
     ClientId      = clientId;
     ClientSecret  = clientSecret;
     Calls         = new PhoneCallsClient(this);
     Campaigns     = new CampaignsClient(this);
     Leads         = new LeadsClient(this);
     Questions     = new QuestionsClient(this);
     SurveyResults = new SurveyResultsClient(this);
     Surveys       = new SurveysClient(this);
 }