public void SaveAllWithMetadata(IEnumerable <Note> notes) { foreach (Note note in notes) { if (note.IsDirty) { _notesRepository.Save(note.Name, note.Content); } _notesMetadataService.AddOrUpdate(note.Name, note.Metadata); } _notesMetadataService.Save(); }
public void AddOrUpdate() { const string noteName = "dummy name"; _sut.Add(noteName, new NoteMetadata { FontFamily = "Arial" }); const string newFontFamily = "Open Sans"; _sut.AddOrUpdate(noteName, new NoteMetadata { FontFamily = newFontFamily }); NoteMetadata retrieved = _sut.Get(noteName); Assert.Equal(newFontFamily, retrieved.FontFamily); }