AsyncExpectation
public struct AsyncExpectation<Value> : Expectation
Undocumented
-
Undocumented
Declaration
Swift
public let expression: AsyncExpression<Value>
-
The status of the test after predicates have been evaluated.
This property can be used for changing test behavior based whether an expectation has passed.
In the below example, we perform additional tests on an array only if it has enough elements.
if expect(array).to(haveCount(10)).status == .passed { expect(array[9]).to(...) }
Remark
Similar functionality can be achieved using theonFailure(throw:)
method.Declaration
Swift
public let status: ExpectationStatus
-
Undocumented
Declaration
Swift
public init(expression: AsyncExpression<Value>)
-
Undocumented
Declaration
Swift
public var location: SourceLocation { get }
-
Takes the result of a test and passes it to the assertion handler.
Declaration
Swift
@discardableResult public func verify(_ pass: Bool, _ message: FailureMessage) -> AsyncExpectation<Value>
Return Value
An updated
Expression
with the result of the test applied to thestatus
property. -
to(_:
Asynchronousdescription: ) Tests the actual value using a matcher to match.
Declaration
Swift
@discardableResult public func to(_ predicate: Predicate<Value>, description: String? = nil) async -> AsyncExpectation<Value>
-
toNot(_:
Asynchronousdescription: ) Tests the actual value using a matcher to not match.
Declaration
Swift
@discardableResult public func toNot(_ predicate: Predicate<Value>, description: String? = nil) async -> AsyncExpectation<Value>
-
notTo(_:
Asynchronousdescription: ) Tests the actual value using a matcher to not match.
Alias to toNot().
Declaration
Swift
@discardableResult public func notTo(_ predicate: Predicate<Value>, description: String? = nil) async -> AsyncExpectation<Value>
-
==(_:
Asynchronous_: ) Undocumented
Declaration
Swift
public static func == (lhs: AsyncExpectation, rhs: ExpectationNil) async
-
!=(_:
Asynchronous_: ) Undocumented
Declaration
Swift
public static func != (lhs: AsyncExpectation, rhs: ExpectationNil) async
-
toEventually(_:
Asynchronoustimeout: pollInterval: description: ) Tests the actual value using a matcher to match by checking continuously at each pollInterval until the timeout is reached.
Declaration
Swift
@discardableResult public func toEventually(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
toEventuallyNot(_:
Asynchronoustimeout: pollInterval: description: ) Tests the actual value using a matcher to not match by checking continuously at each pollInterval until the timeout is reached.
Declaration
Swift
@discardableResult public func toEventuallyNot(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
toNotEventually(_:
Asynchronoustimeout: pollInterval: description: ) Tests the actual value using a matcher to not match by checking continuously at each pollInterval until the timeout is reached.
Alias of toEventuallyNot()
Declaration
Swift
@discardableResult public func toNotEventually(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
toNever(_:
Asynchronousuntil: pollInterval: description: ) Tests the actual value using a matcher to never match by checking continuously at each pollInterval until the timeout is reached.
Declaration
Swift
@discardableResult public func toNever(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
neverTo(_:
Asynchronousuntil: pollInterval: description: ) Tests the actual value using a matcher to never match by checking continuously at each pollInterval until the timeout is reached.
Alias of toNever()
Declaration
Swift
@discardableResult public func neverTo(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
toAlways(_:
Asynchronousuntil: pollInterval: description: ) Tests the actual value using a matcher to always match by checking continusouly at each pollInterval until the timeout is reached
Declaration
Swift
@discardableResult public func toAlways(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>
-
alwaysTo(_:
Asynchronousuntil: pollInterval: description: ) Tests the actual value using a matcher to always match by checking continusouly at each pollInterval until the timeout is reached
Alias of toAlways()
Declaration
Swift
@discardableResult public func alwaysTo(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) async -> AsyncExpectation<Value>