Example #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));
        }
 public void OneTimeSetup()
 {
     this.httpClient = new HttpClient();
     this.service    = new SurveySolutionsApi(this.httpClient, ClientSettings.GetConfiguration());
 }