Exemple #1
0
        public void CanDeleteEntry()
        {
            JournalService entryService = new JournalService();
            var entry = new JournalEntry("CanDeleteEntry test", "test title", "Ttiamus");
            entryService.CreateEntry(entry).Wait();

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

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

            entryService.CreateEntry(entryToInsert).Wait();

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

            Assert.IsTrue(string.Equals(entry.Id, entryToInsert.Id));
        }
Exemple #3
0
        public void CanUpdateEntry()
        {
            JournalService entryService = new JournalService(); ;

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

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

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