Example #1
0
        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();
        }
Example #2
0
        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);
        }