public void StoreSomeNotes()
{
var sample_notes = GetSampleNotes ();
using (var store = new DbStorage (connFactory, testUser.Username, testUser.Manifest)) {
foreach (var note in sample_notes) {
store.SaveNote (note);
}
}
// now check if we have stored that notes
using (var store = new DbStorage (connFactory, testUser.Username, testUser.Manifest)) {
var stored_notes = store.GetNotes ().Values.ToList ();
Assert.AreEqual (sample_notes.Count, stored_notes.Count);
stored_notes.ForEach(n => Assert.Contains (n, sample_notes));
// check that the dates are still the same
stored_notes.ForEach(n => {
var sample_note = sample_notes.First(sn => sn.Guid == n.Guid);
Assert.AreEqual (n.ChangeDate, sample_note.ChangeDate);
});
}
}