Skip to content

Commit

Permalink
updated tests to use unique writekeys
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Sep 13, 2024
1 parent 2340cea commit b7da6cf
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Sources/SegmentConsent-Tests/ConsentBlockerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ConsentBlockerTests: XCTestCase {
}

func testBlockWhenPartialConsentAvailable() {
let analytics = Analytics(configuration: Configuration(writeKey: "test").trackApplicationLifecycleEvents(false))
let analytics = Analytics(configuration: Configuration(writeKey: "cbt.testBlockWhenPartialConsentAvailable").trackApplicationLifecycleEvents(false))

// Artificially give segment.io destination some consent settings
let segmentSettings = [
Expand Down Expand Up @@ -51,7 +51,7 @@ final class ConsentBlockerTests: XCTestCase {
}

func testBlockBecauseNoConsentSettings() {
let analytics = Analytics(configuration: Configuration(writeKey: "test").trackApplicationLifecycleEvents(false))
let analytics = Analytics(configuration: Configuration(writeKey: "cbt.testBlockBecauseNoConsentSettings").trackApplicationLifecycleEvents(false))
let output = OutputReaderPlugin()
let consentManager = ConsentManager(provider: NoConsentProvider())

Expand All @@ -72,7 +72,7 @@ final class ConsentBlockerTests: XCTestCase {
}

func testBlockBecauseNoStamp() {
let analytics = Analytics(configuration: Configuration(writeKey: "test").trackApplicationLifecycleEvents(false))
let analytics = Analytics(configuration: Configuration(writeKey: "cbt.testBlockBecauseNoStamp").trackApplicationLifecycleEvents(false))
let output = OutputReaderPlugin()
let consentManager = ConsentManager(provider: AllConsentProvider())

Expand Down Expand Up @@ -106,7 +106,7 @@ final class ConsentBlockerTests: XCTestCase {
}

func testBlockBecauseNoConsent() {
let analytics = Analytics(configuration: Configuration(writeKey: "test").trackApplicationLifecycleEvents(false))
let analytics = Analytics(configuration: Configuration(writeKey: "cbt.testBlockBecauseNoConsent").trackApplicationLifecycleEvents(false))
let output = OutputReaderPlugin()
let consentManager = ConsentManager(provider: NoConsentProvider())

Expand Down
12 changes: 6 additions & 6 deletions Sources/SegmentConsent-Tests/ConsentNotEnabledAtSegment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ final class ConsentNotEnabledAtSegment: XCTestCase {
}

func testNoToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "testNoToAll")

let settings = Settings.load(resource: "ConsentNotEnabledAtSegment.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "testNoToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -82,10 +82,10 @@ final class ConsentNotEnabledAtSegment: XCTestCase {
}

func testYesToSome() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "testYesToSome")

let settings = Settings.load(resource: "ConsentNotEnabledAtSegment.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "testYesToSome")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -144,10 +144,10 @@ final class ConsentNotEnabledAtSegment: XCTestCase {
}

func testYesToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "testYesToAll")

let settings = Settings.load(resource: "ConsentNotEnabledAtSegment.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "testYesToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ final class DestinationsMultipleCategoriesTests: XCTestCase {
}

func testNoToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "dmc.testNoToAll")

let settings = Settings.load(resource: "DestinationsMultipleCategories.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "dmc.testNoToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -67,10 +67,10 @@ final class DestinationsMultipleCategoriesTests: XCTestCase {
}

func testYesTo1() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "dmc.testYesTo1")

let settings = Settings.load(resource: "DestinationsMultipleCategories.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "dmc.testYesTo1")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -114,10 +114,10 @@ final class DestinationsMultipleCategoriesTests: XCTestCase {
}

func testYesTo2() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "dmc.testYesTo2")

let settings = Settings.load(resource: "DestinationsMultipleCategories.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "dmc.testYesTo2")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -161,10 +161,10 @@ final class DestinationsMultipleCategoriesTests: XCTestCase {
}

func testYesToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "dmc.testYesToAll")

let settings = Settings.load(resource: "DestinationsMultipleCategories.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "dmc.testYesToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ final class NoUnmappedDestinationsTests: XCTestCase {
}

func testNoToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "nud.testNoToAll")

let settings = Settings.load(resource: "NoUnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "nud.testNoToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down
28 changes: 14 additions & 14 deletions Sources/SegmentConsent-Tests/UnmappedDestinationsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testNoToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testNoToAll")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testNoToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -82,10 +82,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesTo1() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesTo1")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesTo1")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -144,10 +144,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesTo2() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesTo2")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesTo2")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -206,10 +206,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesTo3() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesTo3")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesTo3")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -268,10 +268,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesTo4() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesTo4")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesTo4")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -330,10 +330,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesTo1and2() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesTo1and2")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesTo1and2")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down Expand Up @@ -392,10 +392,10 @@ final class UnmappedDestinationsTests: XCTestCase {
}

func testYesToAll() {
removeUserDefaults(forWriteKey: "test")
removeUserDefaults(forWriteKey: "ud.testYesToAll")

let settings = Settings.load(resource: "UnmappedDestinations.json", bundle: Bundle.module)
let analytics = Analytics(configuration: Configuration(writeKey: "test")
let analytics = Analytics(configuration: Configuration(writeKey: "ud.testYesToAll")
.trackApplicationLifecycleEvents(false)
.defaultSettings(settings)
)
Expand Down

0 comments on commit b7da6cf

Please sign in to comment.