 
 /// Defines a stub request case
 public struct ServiceStubRequest {
+    
+    /// URL Path to regex against upcoming requests
     public let path:String
+    
+    /// Optional parameters that will get compare as well against requests with the same kinda of parameters
     public let parameters:[String:Any]?
     
     public init(path:String, parameters:[String:Any]? = nil) {


/// Defines stub response for a matching API path
public struct ServiceStub {
    public let request:ServiceStubRequest
    public let stubType:ServiceStubType
    public let stubBehavior:ServiceStubBehavior
    public let stubCase:ServiceStubCase
    
    public init(execute request:ServiceStubRequest,
                with type:ServiceStubType,
                when stubCase:ServiceStubCase = .unauthenticated,
                react behavior:ServiceStubBehavior = .immediate)
    {
        self.request = request
        self.stubType = type

        self.stubCase = stubCase
    }
}

extension JSONSerialization
{
    
    /// Builds a JSON Dictionary from a bundled json file
    ///
    /// - Parameter fileName: the name of the json file
    /// - Returns: returns a JSON dictionary
    public class func JSONObjectWithFileName(fileName:String) -> [String:Any]?
    {
        if let path = Bundle.currentTestBundle?.path(forResource: fileName, ofType: "json"),
            let jsonData = NSData(contentsOfFile: path),
            let jsonResult = try! JSONSerialization.jsonObject(with: jsonData as Data, options: ReadingOptions.mutableContainers) as? [String:Any]
        {
            return jsonResult
        }
        return nil
    }
}

extension Bundle {
    
    /// Locates the first bundle with a '.xctest' file extension.
    internal static var currentTestBundle: Bundle? {
        return allBundles.first { $0.bundlePath.hasSuffix(".xctest") }
    }
    
}
