     }
 
     func testTrieRouteMatcherWithRouter() {
+        testMatcherMatchesRoutes(TrieRouteMatcher.self)
+    }
 
-        let router = Router(matcher: TrieRouteMatcher.self) { route in
-            route.get("/hello/world") {_ in print("1"); return Response(status: .OK)}
-            route.get("/hello/dan") {_ in print("2"); return Response(status: .OK)}
-            route.get("/api/:version") {_ in print("3"); return Response(status: .OK)}
-            route.get("/servers/json") {_ in print("4"); return Response(status: .OK)}
-            route.get("/servers/:host/logs") {_ in print("5"); return Response(status: .OK)}
+    func testTrieRouteMatcherWithTrailingSlashes() {
+        testMatcherWithTrailingSlashes(TrieRouteMatcher.self)
+    }
+
+    func testTrieRouteMatcherMatchesMethods() {
+        testMatcherMatchesMethods(TrieRouteMatcher.self)
+    }
+
+    func testTrieRouteMatcherParsesPathParameters() {
+        testMatcherParsesPathParameters(TrieRouteMatcher.self)
+    }
+
+
+    func testMatcherMatchesRoutes(matcher: RouteMatcherType.Type) {
+
+        let responder = Responder { request in
+            return Response(status: .OK)
         }
 
+        let routes = [
+            Route(methods: [.GET], path: "/hello/world", middleware: [], responder: responder),
+            Route(methods: [.GET], path: "/hello/dan", middleware: [], responder: responder),
+            Route(methods: [.GET], path: "/api/:version", middleware: [], responder: responder),
+            Route(methods: [.GET], path: "/servers/json", middleware: [], responder: responder),
+            Route(methods: [.GET], path: "/servers/:host/logs", middleware: [], responder: responder)
+        ]
+
+        let matcher = matcher.init(routes: routes)
+
         func route(path: String, shouldMatch: Bool) -> Bool {
-            let req = try! Request(method: .GET, uri: path)
-
-            let status = try! router.respond(req).status
-            if shouldMatch {
-                return status != .NotFound
-            } else {
-                return status == .NotFound
-            }
+            let request = try! Request(method: .GET, uri: path)
+            let matched = matcher.match(request)
+            if shouldMatch { return matched != nil } else { return matched == nil }
         }
 
         XCTAssert(route("/hello/world", shouldMatch: true))

        let getRequest2 = try! Request(method: .GET, uri: "/hello/world123")
        let postRequest2 = try! Request(method: .POST, uri: "/hello/world123")

        XCTAssert(try router.respond(getRequest1).bodyString == "get request")
        XCTAssert(try router.respond(postRequest1).bodyString == "post request")

        XCTAssert(try router.respond(getRequest2).status == .NotFound)
        XCTAssert(try router.respond(postRequest2).status != .NotFound)
    }

    func testTrieRouteMatcherParsesPathParameters() {
        let router = Router(matcher: TrieRouteMatcher.self) { route in
            route.get("/hello/world") {_ in return Response(body: "hello world - not!") }
            route.get("/hello/:location") { return Response(body: "hello \($0.pathParameters["location"]!)") }
            route.post("/hello/:location") { return Response(body: "hello \($0.pathParameters["location"]!)") }
            route.get("/:greeting/:location") { return Response(body: "\($0.pathParameters["greeting"]!) \($0.pathParameters["location"]!)") }
        }

        let helloWorld = try! Request(method: .GET, uri: "/hello/world")

        XCTAssert(route("/servers/json/logs", shouldMatch: true))
    }

    func testMatcherWithTrailingSlashes(matcher: RouteMatcherType.Type) {
        let responder = Responder { request in
            return Response(status: .OK)
        }

        let routes = [
            Route(methods: [.GET], path: "/hello/world", middleware: [], responder: responder)
        ]

        let matcher = matcher.init(routes: routes)

        let request1 = try! Request(method: .GET, uri: "/hello/world")
        let request2 = try! Request(method: .GET, uri: "/hello/world/")

        XCTAssert(matcher.match(request1) != nil)
        XCTAssert(matcher.match(request2) != nil)
    }

    func testMatcherMatchesMethods(matcher: RouteMatcherType.Type) {

        let routes = [
            Route(methods: [.GET], path: "/hello/world", middleware: [], responder: Responder { _ in return Response(body: "get request") }),
            Route(methods: [.POST], path: "/hello/world", middleware: [], responder: Responder { _ in return Response(body: "post request") }),
            Route(methods: [.POST], path: "/hello/world123", middleware: [], responder: Responder { _ in return Response(body: "post request 2") })
        ]

        let matcher = matcher.init(routes: routes)

        let getRequest1 = try! Request(method: .GET, uri: "/hello/world")
        let postRequest1 = try! Request(method: .POST, uri: "/hello/world")
