コード例 #1
0
        public void UpdateEmailNotoficationTest()
        {
            UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value
            //object[] param = null; // TODO: Initialize to an appropriate value
            //target.UpdateEmailNotofication(param);

            UserRegistration _objUserReg = new UserRegistration();
            EmailNotification _objEmaNoti = new EmailNotification();
            int UserId = InsertDummyUser("tj_op");
            _objEmaNoti.UserId = UserId;
            _objEmaNoti.StoryNotify = true;
            _objEmaNoti.NotesNotify = true;
            _objEmaNoti.EventsNotify = true;
            _objEmaNoti.GuestBookNotify = true;
            _objEmaNoti.GiftsNotify = true;
            _objEmaNoti.PhotosNotify = true;
            _objEmaNoti.PhotoAlbumNotify = true;
            _objEmaNoti.VideosNotify = true;
            _objEmaNoti.CommentsNotify = true;
            _objEmaNoti.MessagesNotify = true;
            _objEmaNoti.NewsLetterNotify = true;
            _objUserReg.EmailNotification = _objEmaNoti;
            object[] param = { _objUserReg };
            target.UpdateEmailNotofication(param);
            //Assert.Inconclusive("A method that does not return a value cannot be verified.");

            UserRegistration _objUserReg1 = new UserRegistration();
            TributesPortal.BusinessEntities.Users objUsers = new TributesPortal.BusinessEntities.Users();
            objUsers.UserId = UserId;
            _objUserReg1.Users = objUsers;
            target.GetEmailNotofication(_objUserReg1);

            Assert.AreEqual(true, _objUserReg1.EmailNotification.CommentsNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.EventsNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.GiftsNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.GuestBookNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.MessagesNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.NewsLetterNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.NotesNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.PhotoAlbumNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.PhotosNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.StoryNotify);
            Assert.AreEqual(true, _objUserReg1.EmailNotification.VideosNotify);
        }