Skip to content

Commit

Permalink
fix: rename stop identify function (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
levibostian authored Sep 10, 2021
1 parent 01d6bd7 commit d97e931
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Sources/Tracking/CustomerIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public protocol CustomerIOInstance: AutoMockable {
onComplete: @escaping (Result<Void, CustomerIOError>) -> Void,
jsonEncoder: JSONEncoder?
)
func identifyStop()
func clearIdentify()
}

public extension CustomerIOInstance {
Expand Down Expand Up @@ -310,7 +310,7 @@ public class CustomerIO: CustomerIOInstance {

If no profile has been identified yet, this function will ignore your request.
*/
public func identifyStop() {
public func clearIdentify() {
guard let identifyRepository = self.identifyRepository else {
return
}
Expand Down
18 changes: 9 additions & 9 deletions Sources/Tracking/autogenerated/AutoMockable.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,25 @@ public class CustomerIOInstanceMock: CustomerIOInstance {
identifyBodyClosure?(identifier, AnyEncodable(body), onComplete, jsonEncoder)
}

// MARK: - identifyStop
// MARK: - clearIdentify

/// Number of times the function was called.
public private(set) var identifyStopCallsCount = 0
public private(set) var clearIdentifyCallsCount = 0
/// `true` if the function was ever called.
public var identifyStopCalled: Bool {
identifyStopCallsCount > 0
public var clearIdentifyCalled: Bool {
clearIdentifyCallsCount > 0
}

/**
Set closure to get called when function gets called. Great way to test logic or return a value for the function.
*/
public var identifyStopClosure: (() -> Void)?
public var clearIdentifyClosure: (() -> Void)?

/// Mocked function for `identifyStop()`. Your opportunity to return a mocked value and check result of mock in test code.
public func identifyStop() {
/// Mocked function for `clearIdentify()`. Your opportunity to return a mocked value and check result of mock in test code.
public func clearIdentify() {
mockCalled = true
identifyStopCallsCount += 1
identifyStopClosure?()
clearIdentifyCallsCount += 1
clearIdentifyClosure?()
}
}

Expand Down

0 comments on commit d97e931

Please sign in to comment.