Exemple #1
0
        public async Task should_be_able_to_get_list_of_interviewers()
        {
            SurveySolutionsApiConfiguration options = new SurveySolutionsApiConfiguration(new Credentials("admin", "Qwerty1234"), ClientSettings.HqUrl);
            var adminApiService = new SurveySolutionsApi(httpClient, options);
            var builder         = new HeadquartersQueryQueryBuilder()
                                  .WithUsers(new UsersQueryBuilder()
                                             .WithNodes(new UserQueryBuilder().WithAllScalarFields())
                                             .WithFilteredCount()
                                             .WithTotalCount(),
                                             where : new UsersFilterInput
            {
                Role = new RoleFilterInput {
                    Eq = UserRoles.Interviewer
                }
            },
                                             order: new[]
            {
                new UsersSortInput
                {
                    FullName = SortEnumType.Asc
                }
            });

            var result = await adminApiService.GraphQl.ExecuteAsync <GraphQlResponse>(builder);

            Assert.That(result.Data.Users, Is.Not.Null);
            Assert.That(result.Data.Users.Nodes, Is.Not.Null.Or.Empty);
            Assert.That(result.Data.Users.Nodes.All(x => x.Role == UserRoles.Interviewer));
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="WorkSpacesApi" /> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="options">The options.</param>
 public WorkSpacesApi(HttpClient httpClient, SurveySolutionsApiConfiguration options)
 {
     this.options         = options;
     this.requestExecutor = new RequestExecutor(httpClient);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InterviewsApi"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="options">The options.</param>
 public InterviewsApi(HttpClient httpClient, SurveySolutionsApiConfiguration options)
 {
     this.requestExecutor = new RequestExecutor(httpClient);
     this.options         = options;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SurveySolutionsApi"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="options">The options.</param>
 public SurveySolutionsApi(HttpClient httpClient,
                           SurveySolutionsApiConfiguration options)
 {
     this.httpClient = httpClient;
     this.options    = options;
 }