public VocabularySetTests() { _set = VocabularySet.Empty .WithName(_name) .Add(_alpha) .Add(_beta); }
// // GET: /Set/Edit/5 public ActionResult Edit(int id) { VocabularySet vocabularyset = db.VocabularySets.Include("VocabularyItem").FirstOrDefault(m => m.Id == id); return(View(vocabularyset)); }
// // GET: /Set/Details/5 public ViewResult Details(int id) { VocabularySet vocabularyset = db.VocabularySets.Include(m => m.Words).FirstOrDefault(m => m.Id == id); return(View(vocabularyset)); }
public ActionResult DeleteConfirmed(int id) { VocabularySet vocabularyset = db.VocabularySets.Find(id); db.VocabularySets.Remove(vocabularyset); db.SaveChanges(); return(RedirectToAction("Index")); }
public WithVocabularySet() { var alpha = new VocabularyWord("alpha"); var beta = new VocabularyWord("beta"); _set = VocabularySet.Empty .Add(alpha) .Add(beta); }
public ActionResult Edit(VocabularySet vocabularyset) { if (ModelState.IsValid) { db.Entry(vocabularyset).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vocabularyset)); }
public ActionResult Create(VocabularySet vocabularyset) { if (ModelState.IsValid) { db.VocabularySets.Add(vocabularyset); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vocabularyset)); }
private void removeWord(VocabularyItem itemToRemove) { bool wordIsRemoved = _removeWordFromVocabularyCallback(itemToRemove.id); VocabularySet setToRemove = null; if (wordIsRemoved) { for (int i = 0; i < _vocabularyContents.Count; i++) { VocabularySet set = _vocabularyContents[i]; if (set.section == itemToRemove.section) { set.words.Remove(itemToRemove); if (set.words.Count == 0) { setToRemove = set; } break; } } Control controlToRemove = null; foreach (Control control in _cellsContainer.Controls) { if (control.Tag == itemToRemove) { controlToRemove = control; break; } } if (controlToRemove != null) { _cellsContainer.Controls.Remove(controlToRemove); controlToRemove.Dispose(); if (setToRemove != null) { checkRemoveTitle(setToRemove.section); _vocabularyContents.Remove(setToRemove); } recolourCells(); } } }
public Add() { _empty = VocabularySet.Empty .WithName(_name); }
public void GivenNull_ReturnsFalse() { VocabularySet other = null !; _set.Equals(other).Should().BeFalse(); }
// // GET: /Set/Delete/5 public ActionResult Delete(int id) { VocabularySet vocabularyset = db.VocabularySets.Find(id); return(View(vocabularyset)); }
public static WordTutorApplication ApplicationStateWithVocabulary(VocabularySet words) => new WordTutorApplication(new FakeScreen()) .WithVocabularySet(words);