示例#1
0
        public void GetUsers_WithData_valid()
        {
            // Mock
            var user1 = new User()
            {
                Id = Guid.NewGuid()
            };

            var user2 = new User()
            {
                Id = Guid.NewGuid()
            };

            var user3 = new User()
            {
                Id = Guid.NewGuid()
            };

            bool isActive = true;

            _userRepository.GetUsers(isActive).Returns(new List <User> {
                user1, user2, user3
            });

            // execute

            var result = _sut.GetUsers(isActive);

            //
            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Count());
        }
示例#2
0
        public IEnumerable <ApplicationUser> GetMembers([FromRoute] string id, [FromQuery] int skip = 0, [FromQuery] int top = 0)
        {
            var totalCount = new OptionalOutTotalCount();

            var users = _securityService.GetUsers(null, null, skip, top, totalCount, true, false, new string[] { id }).ToList();

            users.ForEach(u => { u.RemoveNoIdentityClaims(); });

            Request.SetListTotalCount(totalCount.Value);

            return(users);
        }
示例#3
0
        public IEnumerable <ApplicationUser> Get([FromQuery] string filter, [FromQuery] bool?lockedOut, [FromQuery] int skip = 0, [FromQuery] int top = 0,
                                                 [FromQuery] string[] atRoles = null, [FromQuery] string[] withClaims = null)
        {
            var totalCount = new OptionalOutTotalCount();

            var users = _securityService.GetUsers(filter, lockedOut, skip, top, totalCount, true, false, atRoles, withClaims).ToList();

            users.ForEach(u => { u.RemoveNoIdentityClaims(); });

            Request.SetListTotalCount(totalCount.Value);

            return(users);
        }