예제 #1
0
        //TEST:  SPDELETEUSER_TEST
        //Test that a user can be successfully deleted from the database
        public void spDeleteUser_Test()
        {
            //ARRANGE
            string         testUserName = "******";
            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();
            //ACT
            int deletedID = 0;

            foreach (var item in array)
            {
                //Deletion check the passed back ID
                deletedID = db.spDeleteUser(item.UserID);
            }
            //ASSERT
            //If the entry is successfully deleted, the program will return a value of -1. 0 if not successful
            Assert.AreEqual(-1, deletedID);
        }