public void Crud_Success()
        {
            var newPage = Models.CreateDocumentationPage();

            Assert.AreEqual(0, newPage.Id, "The page id should not be set until after data layer Page_Create method is called.");

            DocumentationPageRepository.Create(newPage);
            Assert.AreNotEqual(0, newPage.Id, "The page id should have been set by the data layer.");

            var oldTitle = newPage.Title;

            newPage.Title = "New Page Title";
            DocumentationPageRepository.Update(newPage);

            var existingPage = DocumentationPageRepository.Read(newPage.Id);

            Assert.IsNotNull(existingPage, "The page should exist in the database.");
            Assert.AreNotEqual(oldTitle, existingPage.Title, "The page's title should have been updated.");
            Assert.AreEqual(newPage.Content, existingPage.Content, "The rest of the page instances' contents should be the same.");

            DocumentationPageRepository.Delete(newPage.Id);

            var deletedPage = DocumentationPageRepository.Read(newPage.Id);

            Assert.That(deletedPage, Is.Null, "The page should have been deleted from the database.");
        }
        public void Import_NewPage()
        {
            // Arrange
            var page = Models.CreateDocumentationPage();

            page.Id = 10573;

            // Act
            DocumentationPageRepository.Import(page);
            var result = DocumentationPageRepository.Read(page.Id);

            // Assert
            Assert.That(result, Is.Not.Null, "The page should have been created with the supplied id.");
            Assert.That(result.Title, Is.EqualTo(page.Title), "The page Title should have been added to the data store.");
        }
        public void Import_ExistingPage()
        {
            // Arrange
            var page = Models.CreateDocumentationPage();

            DocumentationPageRepository.Create(page);

            page.Title = "Imported existing page title.";

            // Act
            DocumentationPageRepository.Import(page);
            var result = DocumentationPageRepository.Read(page.Id);

            // Assert
            Assert.That(result, Is.Not.Null, "The page should still exist in the repository.");
            Assert.That(result.Title, Is.EqualTo(page.Title), "The title should have been updated on import.");
        }