From ff0e99a93178e0979664d8f310560d47d22e5b0c Mon Sep 17 00:00:00 2001 From: Yang Xu Date: Sat, 19 Mar 2022 07:41:59 +0800 Subject: [PATCH] fix container instance error --- .../ContainerManagerTests.swift | 2 +- .../QueueHandlerForMultipleTests.swift | 6 +++++- .../QueueHandlerForOneByOneTests.swift | 2 +- .../QueueHandlerForOneByeOneWaitFinishTests.swift | 2 +- Tests/SwiftUIOverlayContainerTests/QueueHandlerTests.swift | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Tests/SwiftUIOverlayContainerTests/ContainerManagerTests.swift b/Tests/SwiftUIOverlayContainerTests/ContainerManagerTests.swift index 84e4b3b..64f7f1f 100644 --- a/Tests/SwiftUIOverlayContainerTests/ContainerManagerTests.swift +++ b/Tests/SwiftUIOverlayContainerTests/ContainerManagerTests.swift @@ -17,7 +17,7 @@ import XCTest // swiftlint:disable redundant_discardable_let class ContainerManagerTests: XCTestCase { - let manager = ContainerManager() + let manager = ContainerManager.share override func setUp() { manager.publishers.removeAll() diff --git a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForMultipleTests.swift b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForMultipleTests.swift index f3b227c..e1d9c04 100644 --- a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForMultipleTests.swift +++ b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForMultipleTests.swift @@ -18,9 +18,13 @@ class QueueHandlerForMultipleUnitTests: XCTestCase { var containerConfiguration: ContainerConfiguration! var handler: ContainerQueueHandler! + override class func setUp() { + ContainerManager.share.publishers.removeAll() + } + @MainActor override func setUp() { - manager = ContainerManager() + manager = ContainerManager.share manager.debugLevel = 3 self.containerConfiguration = ContainerConfiguration( displayType: .stacking, queueType: .multiple, delayForShowingNext: 0 diff --git a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByOneTests.swift b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByOneTests.swift index 12a83ae..81ab122 100644 --- a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByOneTests.swift +++ b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByOneTests.swift @@ -15,7 +15,7 @@ import XCTest @MainActor class QueueHandlerForOneByOneTests: XCTestCase { - let manager = ContainerManager() + let manager = ContainerManager.share var containerConfiguration: ContainerConfiguration! var handler: ContainerQueueHandler! diff --git a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByeOneWaitFinishTests.swift b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByeOneWaitFinishTests.swift index ba44445..53b5e94 100644 --- a/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByeOneWaitFinishTests.swift +++ b/Tests/SwiftUIOverlayContainerTests/QueueHandlerForOneByeOneWaitFinishTests.swift @@ -15,7 +15,7 @@ import XCTest @MainActor class QueueHandlerForOneByeOneWaitFinishTests: XCTestCase { - let manager = ContainerManager() + let manager = ContainerManager.share var containerConfiguration: ContainerConfiguration! var handler: ContainerQueueHandler! diff --git a/Tests/SwiftUIOverlayContainerTests/QueueHandlerTests.swift b/Tests/SwiftUIOverlayContainerTests/QueueHandlerTests.swift index cfca000..15b1071 100644 --- a/Tests/SwiftUIOverlayContainerTests/QueueHandlerTests.swift +++ b/Tests/SwiftUIOverlayContainerTests/QueueHandlerTests.swift @@ -14,7 +14,7 @@ import XCTest @MainActor class QueueHandlerTests: XCTestCase { - let manager = ContainerManager() + let manager = ContainerManager.share var containerConfiguration: ContainerConfiguration! var handler: ContainerQueueHandler!