Beispiel #1
0
        public void CanDeleteEntry()
        {
            var entryRepo = new JournalRepo();
            var entry = new JournalEntry("CanDeleteEntry test", "test title", "Ttiamus");
            entryRepo.CreateEntry(entry).Wait();

            var deleteEntryTask = entryRepo.DeleteEntry(entry.Id);
            deleteEntryTask.Wait();
            Assert.IsNull(entryRepo.GetEntry(entry.Id).Result);
        }
Beispiel #2
0
        public void CanGetEntry()
        {
            var entryRepo = new JournalRepo();

            var entryToInsert = new JournalEntry("UnitTestEntry", "test title", "Ttiamus");

            entryRepo.CreateEntry(entryToInsert).Wait();

            var entry = entryRepo.GetEntry(entryToInsert.Id).Result;

            var id1 = entryToInsert.Id;
            var id2 = entry.Id;
            var test = string.Equals(id1, id2);
            Assert.IsTrue(string.Equals(entry.Id, entryToInsert.Id));
        }
Beispiel #3
0
        public void CanUpdateEntry()
        {
            var entryRepo = new JournalRepo();

            var entryToUpdate = new JournalEntry("Entry To Update", "test title", "Ttiamus");
            entryRepo.CreateEntry(entryToUpdate).Wait();

            var entry = new JournalEntry("CanUpdateEntryTest", "test title", "Ttiamus") {Id = entryToUpdate.Id};

            var updateEntryTask = entryRepo.UpdateEntry(entry);
            updateEntryTask.Wait();
            Assert.AreEqual("CanUpdateEntryTest", entryRepo.GetEntry(entryToUpdate.Id).Result.Body);
        }