# Count

``public enum Count : ExpressibleByIntegerLiteral``

Count enum. Use it for all Verify features, when checking how many times something happened.

There are three ways of using it:

1. Explicit literal - you can pass 0, 1, 2 … to verify exact number
2. Using predefined .custom, to specify custom matching rule.
3. Using one of predefined rules, for example:
• .atLeastOnce
• .exactly(1)
• .from(2, to: 4)
• .less(than: 2)
• .lessOrEqual(to: 1)
• .more(than: 2)
• .moreOrEqual(to: 3)
• .never
• ``` CustomMatchingClosure ```

Count matching closure

#### Declaration

Swift

``public typealias CustomMatchingClosure = (_ value: Int) -> Bool``
• ``` IntegerLiteralType ```

[Internal] Count is represented by integer literals, with type Int

#### Declaration

Swift

``public typealias IntegerLiteralType = Int``
• ``` atLeastOnce ```

Called at least once

#### Declaration

Swift

``case atLeastOnce``
• ``` once ```

Called exactly once

#### Declaration

Swift

``case once``
• ``` custom(_:) ```

Custom count resolving closure

#### Declaration

Swift

``case custom(CustomMatchingClosure)``
• ``` exactly(_:) ```

Called exactly n times

#### Declaration

Swift

``case exactly(Int)``
• ``` from(_:to:) ```

Called in a…b range

#### Declaration

Swift

``case from(Int, to: Int)``
• ``` less(than:) ```

Called less than n times

#### Declaration

Swift

``case less(than: Int)``
• ``` lessOrEqual(to:) ```

Called less than ot equal to n times

#### Declaration

Swift

``case lessOrEqual(to: Int)``
• ``` more(than:) ```

Called more than n times

#### Declaration

Swift

``case more(than: Int)``
• ``` moreOrEqual(to:) ```

Called more than ot equal to n times

#### Declaration

Swift

``case moreOrEqual(to: Int)``
• ``` never ```

Never called

#### Declaration

Swift

``case never``
• ``` init(integerLiteral:) ```

Creates new count instance, matching specific count

#### Declaration

Swift

``public init(integerLiteral value: IntegerLiteralType)``

#### Parameters

 ``` value ``` Exact count value
• ``` description ```

#### Declaration

Swift

``public var description: String { get }``
• ``` matches(_:) ```

Returns whether given count matches countable case.

#### Declaration

Swift

``public func matches(_ count: Int) -> Bool``

#### Parameters

 ``` count ``` Given count

#### Return Value

true, if it is within boundaries, false otherwise