コード例 #1
0
        public static async Task ClassInitialize(TestContext tc)
        {
            UserController.Instance.isTestMode  = true;
            ServerConfig.Instance.serverAddress = "http://csse-s302g3.canterbury.ac.nz:80/testing/api/v1";
            loginAPI = new LoginAPI();
            drugAPI  = new DrugInteractionAPI();

            await UnitTestUtils.resetResample();
        }
コード例 #2
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);
        }