         XCTAssert(route("/servers/json/logs", shouldMatch: true))
     }
 
-    func testTrieRouteMatcherWithTrailingSlashes() {
-        let router = Router(matcher: TrieRouteMatcher.self) { route in
-            route.get("/hello/world") {_ in print("hello!"); return Response(status: .OK) }
+    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(try router.respond(request1).status != .NotFound)
-        XCTAssert(try router.respond(request2).status != .NotFound)
+        XCTAssert(matcher.match(request1) != nil)
+        XCTAssert(matcher.match(request2) != nil)
     }
-    
-    func testTrieRouteMatcherMatchesMethodsProperly() {
-        let router = Router(matcher: TrieRouteMatcher.self) { route in
-            route.get("/hello/world") {_ in return Response(body: "get request") }
-            route.post("/hello/world") {_ in return Response(body: "post request") }
-            route.post("/hello/world123") {_ in return Response(body: "post request 2") }
-        }
+
+    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")

    }

    func testTrieRouteMatcherWithRouter() {

        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 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
            }
        }

        XCTAssert(route("/hello/world", shouldMatch: true))

//
//

@testable import TrieRouteMatcher
import XCTest

