public void DeleteEntryDeletesEntry()
        {
            //Arrange:
            // Instantiate EntriessController so its methods can be called
            // Create a new entry to be deleted, and get its entry ID
            var entryController = new EntriesController();

            var entry = new EntryModel
            {
                Name = "Zia Prostnow",
                EntryText = "Whippersnappers!"
            };
            IHttpActionResult result = entryController.PostEntry(entry);
            CreatedAtRouteNegotiatedContentResult<EntryModel> contentResult =
                (CreatedAtRouteNegotiatedContentResult<EntryModel>)result;

            int entryIdToDelete = contentResult.Content.EntryId;

            //Act: Call DeleteEntry
            result = entryController.DeleteEntry(entryIdToDelete);

            //Assert:
            // Verify that HTTP result is OK
            // Verify that reading deleted entry returns result not found
            Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult<Entry>));

            result = entryController.GetEntry(entryIdToDelete);
            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
        public void PostEntryCreatesEntry()
        {
            //Arrange: Instantiate EntriesController so its methods can be called
            var entryController = new EntriesController();

            //Act:
            // Create an EntryModel object populated with test data,
            //  and call PostEntry
            var newEntry = new EntryModel
            {
                Name = "Testy",
                EntryText = "Welcome to my world!"
            };
            IHttpActionResult result = entryController.PostEntry(newEntry);

            //Assert:
            // Verify that the HTTP result is CreatedAtRouteNegotiatedContentResult
            // Verify that the HTTP result body contains a nonzero entry ID
            Assert.IsInstanceOfType
                (result, typeof(CreatedAtRouteNegotiatedContentResult<EntryModel>));
            CreatedAtRouteNegotiatedContentResult<EntryModel> contentResult =
                (CreatedAtRouteNegotiatedContentResult<EntryModel>)result;
            Assert.IsTrue(contentResult.Content.EntryId != 0);

            // Delete the test entry
            result = entryController.DeleteEntry(contentResult.Content.EntryId);
        }