protected void btnAssignTag_Click(object sender, EventArgs e) { clsFilmMoodCollection aFilmMood = new clsFilmMoodCollection(); aFilmMood.ThisFilmMood.UserId = Convert.ToInt32(Session["UserId"]); aFilmMood.ThisFilmMood.FilmId = Convert.ToInt32(Session["FilmId"]); aFilmMood.ThisFilmMood.MoodId = Convert.ToInt32(ddlFilmMoods.SelectedItem.Value); aFilmMood.Add(); DisplayUserAssignedMoods(); }
public void AddMethodOk() { clsFilmMoodCollection AllFilmMoods = new clsFilmMoodCollection(); clsFilmMood TestItem = new clsFilmMood(); TestItem.FilmId = 2; TestItem.UserId = 1; TestItem.MoodId = 2; AllFilmMoods.ThisFilmMood = TestItem; AllFilmMoods.Add(); AllFilmMoods.ThisFilmMood.Find(TestItem.FilmId, TestItem.UserId, TestItem.MoodId); }
public void Delete() { clsFilmMoodCollection AllFilmMoods = new clsFilmMoodCollection(); clsFilmMood TestItem = new clsFilmMood(); TestItem.FilmId = 1; TestItem.UserId = 1; TestItem.MoodId = 3; AllFilmMoods.ThisFilmMood = TestItem; AllFilmMoods.Add(); AllFilmMoods.ThisFilmMood.Find(TestItem.FilmId, TestItem.UserId, TestItem.MoodId); AllFilmMoods.Delete(); Boolean found = AllFilmMoods.ThisFilmMood.Find(TestItem.FilmId, TestItem.UserId, TestItem.MoodId); Assert.IsFalse(found); }