Skip to content

Commit

Permalink
Added testClearInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
asenthil-altmtrk committed Mar 20, 2020
1 parent ea737fb commit ccc46a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/InsightsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ final class InsightsTests: XCTestCase {
XCTAssertEqual(countAfterSave, 15, "There should be 15 Click events in the storage")
}

func testClearInstance() {
Insights.setup(environment: environment,
programToken: programToken,
sdkVersion: sdkVersion,
apiUrl: InsightsTestHelper.restURL,
userToken: userToken)
XCTAssertNotNil(Insights.shared, "Insight instance should not equal to nil")
Insights.clearInstance()
XCTAssertNil(Insights.shared, "Insight instance should equal to nil")
}

private func setEventRequest(_ payload: Data, _ error: NSError? = nil) -> StubRequest {
let response = InsightsTestHelper.setUpMockedResponse(payload: payload, error: error)
let baseUrl = InsightsTestHelper.restURL
Expand Down

0 comments on commit ccc46a2

Please sign in to comment.