예제 #1
0
        public void LoginTestSimplePasses()
        {
            // NOTE: Starts with known user in database,
            // fails if user doesn't already exsist

            ////////////////////////////////////////////////////
            // TEST 1: Login with good username/password combo
            ////////////////////////////////////////////////////

            // Call login method with input
            string user1 = "RegTestUser";
            string pass1 = "RegTestPass";

            HomePage.Instance.CallLogin();
            bool success = HomePageMock.CallLogin(user1, pass1);

            Assert.True(success);

            ////////////////////////////////////////////////////
            // TEST 2: Login with good username, bad password
            ////////////////////////////////////////////////////

            // Call login method with input
            user1 = "RegTestUser";
            pass1 = "RegTestPassBad";

            HomePage.Instance.CallLogin();
            success = HomePageMock.CallLogin(user1, pass1);
            Assert.False(success);

            ////////////////////////////////////////////////////
            // TEST 3: Login with good password, bad username
            ////////////////////////////////////////////////////

            // Call login method with input
            user1 = "RegTestUserBad";
            pass1 = "RegTestPass";

            HomePage.Instance.CallLogin();
            success = HomePageMock.CallLogin(user1, pass1);
            Assert.False(success);

            ////////////////////////////////////////////////////
            // TEST 4: Login with bad password, bad username
            ////////////////////////////////////////////////////

            // Call login method with input
            user1 = "RegTestUserBad";
            pass1 = "RegTestPassBad";

            HomePage.Instance.CallLogin();
            success = HomePageMock.CallLogin(user1, pass1);
            Assert.False(success);
        }
예제 #2
0
        public void RegisterTestSimplePasses()
        {
            // Use the Assert class to test conditions

            //GameObject gameObj = new GameObject("HomePage");
            //HomePage home = gameObj.AddComponent<HomePage>();

            //////////////////////////////////////////////////
            // TEST 1: create valid new user
            //////////////////////////////////////////////////

            // Call registration method with input
            string user1   = "RegTestUserNEW";
            string pass1   = "RegTestPassNEW";
            bool   success = HomePageMock.CallRegister(user1, pass1);

            Assert.True(success);

            /////////////////////////////////////////////////////////
            // TEST 2: create invalid new user, user already exists
            /////////////////////////////////////////////////////////

            // Call registration method with input
            user1   = "RegTestUser";
            pass1   = "RegTestPass";
            success = HomePageMock.CallRegister(user1, pass1);
            Assert.False(success);

            /////////////////////////////////////////////////////////
            // TEST 3: create valid new user, with repeat password
            /////////////////////////////////////////////////////////

            // Call registration method with input
            user1   = "RegTestUserNEW";
            pass1   = "RegTestPass";
            success = HomePageMock.CallRegister(user1, pass1);
            Assert.True(success);
        }