예제 #1
0
        //TEST:  SPADDUSER_TEST
        //Test that adding a user to the database is successful
        public void spAddUser_Test()
        {
            //ARRANGE
            string         testUserName = "******"; string testEmailAddress = "*****@*****.**";
            MyDataEntities db = new MyDataEntities();
            //ACT
            ObjectResult <Store.Data.spAddUser_Result> result = db.spAddUser(testUserName, testEmailAddress);
            //Use the testUserName to get the User object that we just made
            var item = db.Users.Where(x => x.UserName == testUserName).FirstOrDefault();

            string returnUserName     = item.UserName;
            string returnEmailAddress = item.EmailAddress;

            //ASSERT
            //Compare the UserName and Password we started with and ensure that the User Object has the same properties.
            Assert.AreEqual(testUserName, returnUserName);
            Assert.AreEqual(testEmailAddress, returnEmailAddress);
        }