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

            Assert.Equal(1, results.Count);

            var user = results.First();

            Assert.Equal("name.1", user.Name);
            Assert.Equal("email.1", user.Email);
            Assert.Equal("1", user.ExternalId);
            Assert.Equal(1, user.DefaultGroupId);
        }
Ejemplo n.º 2
0
        public async Task ShouldGetAllUsersInGroup()
        {
            var obj1 = new UserCreateRequest("name")
            {
                Email          = "*****@*****.**",
                DefaultGroupId = 1
            };

            var obj2 = new UserCreateRequest("name")
            {
                Email          = "*****@*****.**",
                DefaultGroupId = 2
            };

            var objr1 = await _resource.CreateAsync(obj1);

            var objr2 = await _resource.CreateAsync(obj2);

            var obj1Result = (await _resource.ListInGroupAsync(1)).ToArray()[0];
            var obj2Result = (await _resource.ListInGroupAsync(2)).ToArray()[0];

            Assert.Equal(JsonConvert.SerializeObject(objr1), JsonConvert.SerializeObject(obj1Result));
            Assert.Equal(JsonConvert.SerializeObject(objr2), JsonConvert.SerializeObject(obj2Result));
        }