コード例 #1
0
        /*
         * Fetches the users and checks if all users have been taken from DB
         */
        private async Task <List <User> > getUsers(int startIndex, int count)
        {
            UserAPI userAPI = new UserAPI();
            Tuple <HttpStatusCode, List <User> > users = await userAPI.GetUsers(startIndex, count, searchQuery);

            if (users.Item1 != HttpStatusCode.OK)
            {
                return(new List <User>());
            }

            if (users.Item2.Count < 20)
            {
                endOfUsers = true;
            }
            return(users.Item2);
        }
コード例 #2
0
        public async Task getUsers()
        {
            // Check auth
            if (ClinicianController.Instance.AuthToken == null)
            {
                // Login as clinician to grab token with getUsers capability
                await loginAPI.LoginUser("default", "default");
            }

            Tuple <HttpStatusCode, List <User> > result = await userAPI.GetUsers(0, 9, "");

            Assert.AreEqual(HttpStatusCode.OK, result.Item1);
            Assert.AreEqual(8, result.Item2.Count);

            Assert.AreEqual("Andrew", result.Item2[0].name[0]);
            Assert.AreEqual("Nicky", result.Item2[7].name[0]);
        }