public void DeleteTaxonomyNote() { BO.Taxonomy.TaxonomyNote[] notes = mSpecies.GetNotes(); BO.Taxonomy.TaxonomyNote newNote = AddTaxonomyNote(mSpecies); int id = newNote.NoteId; newNote.Delete(); Assert.IsTrue(notes.Length == mSpecies.GetNotes().Length); }
public void GetTaxonomyNotes() { BO.Taxonomy.TaxonomyNote[] notes1 = mSpecies.GetNotes(); BO.Taxonomy.TaxonomyNote newNote = AddTaxonomyNote(mSpecies); BO.Taxonomy.TaxonomyNote[] notes2 = mSpecies.GetNotes(); Assert.IsTrue(notes2.Length == notes1.Length + 1); newNote.Delete(); Assert.IsTrue(mSpecies.GetNotes().Length == notes1.Length); }
/// <summary> /// Adds a species note to a species. /// </summary> /// <param name="taxon">the species to receive the new note</param> /// <returns>the species note</returns> protected BO.Taxonomy.TaxonomyNote AddTaxonomyNote(BOTaxon taxon) { BO.Taxonomy.TaxonomyNote note = new BO.Taxonomy.TaxonomyNote(); note.OtherId = taxon.Id; note.Content = "Test"; note.Subject = "Test"; note.Active = true; note = (BO.Taxonomy.TaxonomyNote)note.Save(); Assert.IsNotNull(note); Assert.IsTrue(note.NoteId > 0); return(note); }