예제 #1
0
        //TEST:  SQLSECURITYMANAGER_ISADMIN_FAILURETEST
        //Test the functionality of the SqlSecurityManager IsAdmin method when using unintended test data.
        //Uses our newly created user who is not an admin to show that IsAdmin will return false when given a non-admin.
        public void SqlSecurityManager_IsAdmin_FAILURETest()
        {
            SqlSecurityManager manager = new SqlSecurityManager();

            //ARRANGE
            //These parameters refer to the test user that we created in SqlSecurityManager_RegisterUser
            string testUsername = "******";
            bool   result;

            //ACT
            result = manager.IsAdmin(testUsername);
            //ASSERT
            Assert.IsNotNull(result);
            Assert.IsFalse(result);
        }
예제 #2
0
        //TEST:  SQLSECURITYMANAGER_ISADMIN_TEST
        //Test the functionality of the SqlSecurityManager IsAdmin method using test data.
        public void SqlSecurityManager_IsAdmin_Test()
        {
            SqlSecurityManager manager = new SqlSecurityManager();

            //ARRANGE
            //The only Admin username in the DB
            string username = "******";
            bool   result;

            //ACT
            result = manager.IsAdmin(username);
            //ASSERT
            Assert.IsNotNull(result);
            Assert.IsTrue(result);
        }