public void AddNoteActionAddsNoteToCustomer() { Note note = new Note { ID = 1, Body = "Test Note" }; controller.AddNote(1, note); Customer customer = repo.GetCustomerById(1); CollectionAssert.Contains(customer.Notes, note); }
public void AddNote(Note note) { int ID = note.CustomerID; Customer customer = db.Find(d => d.ID == ID); customer.Notes.Add(note); }
public void AddNote(Note note) { db.Notes.Add(note); db.SaveChanges(); }