 import XCTest
 
 @testable import SteamPress
+import Fluent
+import Vapor
 
 class BlogPostTests: XCTestCase {
 

        ("testSlugUrlLowerCases", testSlugUrlLowerCases),
        ("testEverythingWithLotsOfCharacters", testEverythingWithLotsOfCharacters),
    ]

    func testThatSlugUrlCalculatedCorrectlyForTitleWithSpaces() {
        let title = "This is a title"

        let post = TestDataBuilder.anyPost(slugUrl: title)
        XCTAssertEqual(expectedSlugUrl, post.slugUrl)
    }
    
    func testSlugUrlGivenUniqueNameIfDuplicate() {
        let title = "A duplicated title"
        let expectedSlugUrl = "a-duplicated-title-2"
        do {
            var post1 = TestDataBuilder.anyPost(slugUrl: title)
            try post1.save()
            let post2 = TestDataBuilder.anyPost(slugUrl: title)
            XCTAssertEqual(expectedSlugUrl, post2.slugUrl)
        }
        catch {
            XCTFail("Test threw unexpected exception")
        }
    }

    // TODO test snippets
    // TODO test tag pivot logic

}
