Esempio n. 1
0
        public async Task getUserCount()
        {
            // Ensure DB is reset correctly
            await UnitTestUtils.resetResample();

            // Check auth
            if (ClinicianController.Instance.AuthToken == null)
            {
                // Login as clinician to grab token with getUsers capability
                await loginAPI.LoginUser("default", "default");
            }

            Tuple <HttpStatusCode, int> result = await userAPI.GetUserCount();

            Assert.AreEqual(HttpStatusCode.OK, result.Item1);
            Assert.AreEqual(8, result.Item2);
        }
Esempio n. 2
0
        /*
         * Populates the details fields
         */
        private async void fillFields()
        {
            Models.Clinician currentClinician = ClinicianController.Instance.LoggedInClinician;

            // Database Pane
            UserAPI userAPI = new UserAPI();
            Tuple <HttpStatusCode, int> userCountResult = await userAPI.GetUserCount();

            if (userCountResult.Item1 == HttpStatusCode.OK)
            {
                // Successfully fetched usercount -> apply label
                UserCountLabel.Text = String.Format("There are {0} users currently in the database", userCountResult.Item2);
            }
            else
            {
                UserCountLabel.Text = String.Format("Failed to get result from database ({0})", userCountResult.Item1);
            }
        }