 
 import Foundation
 
+/// **FuncCallHandler** handles calls of a particular function.
+/// Each function has its arguments and a return value. Their types are defined via generic class mechanizm.
+/// If there are several arguments it is recommended to create a structure or a class to incapsulate the arguments inside.
 public class FuncCallHandler<TArgs, TReturn> {
     
     fileprivate var callHistory: [TArgs] = []
     fileprivate let returnValue: TReturn
     
     fileprivate var stub: Stub<TArgs, TReturn>?
-    let callRealFunc: ((_ args: TArgs) -> TReturn)?
+    fileprivate let callRealFunc: ((_ args: TArgs) -> TReturn)?
     
-    let isPartial: Bool
+    fileprivate let isPartial: Bool
     
+    /// Creates an instance of FuncCallHandler
+    ///
+    /// - Parameters:
+    ///   - returnValue: A default value to return for func calls
+    ///   - isPartial: If true - real func is called every time after call registration instead of returning default value
+    ///   - callRealFunc: A closure which calls inside real func (not mocked)
     public init(returnValue: TReturn,
                 isPartial: Bool = false,
                 callRealFunc: ((_ args: TArgs) -> TReturn)? = nil) {

    }

    //MARK: - verify
    @discardableResult
    public func verify(called rule: CallTimesRule) throws -> Bool {
        try rule.verify(callTimesCount())
        return true
    }
    
    func callTimesCount() -> Int {
        return callHistory.count
    }
    
    //MARK: - args
    public func args() -> TArgs? {
        return args(callTime: callTimesCount() - 1)
    }
    
    public func args(callTime: Int) -> TArgs? {
        guard callTime > -1,
            callTime < callTimesCount() else { return nil }

    }

    //MARK: - stub
    
    /// Creates a stub on first call. After calling this function stub **will always be used** as a prioritized way to get the function result at *handle(TArgs) -> TReturn*.
    ///
    /// - Returns: A stub
    public func whenCalled() -> Stub<TArgs, TReturn> {
        if let stub = stub {
            return stub
