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);
 }
示例#3
0
 public void AddNote(Note note)
 {
     db.Notes.Add(note);
     db.SaveChanges();
 }