Ejemplo n.º 1
0
        public async Task ListAssignableAsync_WhenCalledWithUserId_ShouldGetAll()
        {
            var results = await _resource.ListAssignableAsync();

            Assert.Equal(100, results.Count);

            for (var i = 1; i <= 100; i++)
            {
                var item = results.ElementAt(i - 1);

                Assert.Equal(i, item.Id);
                Assert.Equal($"name.{i}", item.Name);
                Assert.Equal(new Uri($"https://company.zendesk.com/api/v2/groups/{i}.json"), item.Url);
            }
        }
Ejemplo n.º 2
0
        public async Task ShouldListAllAssignable()
        {
            var group1 = await _resource.CreateAsync(new GroupCreateRequest("DJs Assign:true"));

            var group2 = await _resource.CreateAsync(new GroupCreateRequest("MCs Assign:true"));

            var group3 = await _resource.CreateAsync(new GroupCreateRequest("DJs Assign:false"));

            var groups = (await _resource.ListAssignableAsync()).ToArray();

            Assert.Equal(2, groups.Length);
            Assert.Equal(JsonConvert.SerializeObject(group1), JsonConvert.SerializeObject(groups[0]));
            Assert.Equal(JsonConvert.SerializeObject(group2), JsonConvert.SerializeObject(groups[1]));
        }