示例#1
0
        //TEST:  SPUPDATEUSER_TEST
        //Test that a user's details can be updated successfully
        public void spUpdateUser_Test()
        {
            //ARRANGE
            string         testUserName = "******"; string testEmailAddress = "*****@*****.**";
            MyDataEntities db = new MyDataEntities();
            //Grab the user we want to manipulate based on the testUserName parameter
            var array = db.Users.Where(x => x.UserName == testUserName).ToList();

            //We already grabbed the user with our previous UserName, now we can change it to what we want to test
            testUserName = "******";
            //ACT
            int successfulUpdateID = 0;

            foreach (var item in array)
            {
                //Update + check the passed back ID
                successfulUpdateID = db.spUpdateUser(item.UserID, testUserName, testEmailAddress);
            }
            //ASSERT
            //If the entry is successfully updated, the program will return a value of -1. 0 if not successful
            Assert.AreEqual(-1, successfulUpdateID);
        }