Skip to content

Commit

Permalink
Make test mocks internal and import with @testable.
Browse files Browse the repository at this point in the history
Fix variable declaration
  • Loading branch information
joshdubey committed Jan 8, 2025
1 parent e030a31 commit d4e6ba8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation

@MainActor
open class BaseViewController: UIViewController {
private(set) public var analyticsService: AnalyticsServiceInterface
public let analyticsService: AnalyticsServiceInterface

public init(analyticsService: AnalyticsServiceInterface) {
self.analyticsService = analyticsService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import Foundation
import GOVKit

@MainActor
public class MockBaseViewController: BaseViewController,
TrackableScreen {
public var trackingName: String { "test_mock_tracking_name" }
public var additionalParameters: [String : Any] { ["test_param": "test_value"] }

public var _receivedBeginAppearanceTransitionAnimated: Bool?
public override func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) {
class MockBaseViewController: BaseViewController,
TrackableScreen {
var trackingName: String { "test_mock_tracking_name" }
var additionalParameters: [String : Any] { ["test_param": "test_value"] }
var _receivedBeginAppearanceTransitionAnimated: Bool?
override func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) {
super.beginAppearanceTransition(isAppearing, animated: animated)
_receivedBeginAppearanceTransitionAnimated = animated
}

public var _endAppearanceTransitionCalled: Bool = false
public override func endAppearanceTransition() {
var _endAppearanceTransitionCalled: Bool = false
override func endAppearanceTransition() {
super.endAppearanceTransition()
_endAppearanceTransitionCalled = true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Foundation

public class MockNotificationCenter: NotificationCenter,
@unchecked Sendable {

public var _receivedObservers: [(name: NSNotification.Name, object: Any)] = []
public override func addObserver(
class MockNotificationCenter: NotificationCenter,
@unchecked Sendable {
var _receivedObservers: [(name: NSNotification.Name, object: Any)] = []
override func addObserver(
forName name: NSNotification.Name?,
object obj: Any?,
queue: OperationQueue?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Testing
import GOVKitTestUtilities

@testable import GOVKitTestUtilities
@testable import govuk_ios

@Suite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Testing

import FirebaseAnalytics
import GOVKit
import GOVKitTestUtilities

@testable import GOVKitTestUtilities
@testable import govuk_ios

@Suite(.serialized)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation

import Testing
import GOVKitTestUtilities

@testable import GOVKitTestUtilities
@testable import govuk_ios

@Suite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Foundation
import CoreData
import Testing
import GOVKitTestUtilities
import RecentActivity

@testable import GOVKitTestUtilities
@testable import govuk_ios

@Suite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import UIKit
import Foundation
import Testing
import GOVKit
import GOVKitTestUtilities

@testable import GOVKitTestUtilities
@testable import govuk_ios

@Suite
Expand Down

0 comments on commit d4e6ba8

Please sign in to comment.