File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,5 +135,5 @@ extension HomeViewController: @MainActor PresenterToViewHomeProtocol {
135135// MARK: - Preview
136136#Preview {
137137 let module = ICTMDBHomeModule ( )
138- module. createHomeModule ( )
138+ UINavigationController ( rootViewController : module. createHomeModule ( ) )
139139}
Original file line number Diff line number Diff line change @@ -42,6 +42,20 @@ struct ICTMDBHomeModuleTests {
4242 #expect( view. invokedSetBackColorAbleData == [ " backColor " ] )
4343 }
4444
45+
46+ @Test ( " Set navigaiton title " )
47+ func testNavigationTitle( ) {
48+ #expect( view. invokedSetNavigationTitle == false )
49+ #expect( view. invokedSetNavigationTitleCount == 0 )
50+
51+ presenter. viewDidLoad ( )
52+
53+ #expect( view. invokedSetNavigationTitle == true )
54+ #expect( view. invokedSetNavigationTitleCount == 1 )
55+ #expect( view. invokedSetNavigationTitleData. map ( \. title) == [ " Home Page " ] )
56+
57+ }
58+
4559 @Test ( " Check number of sections " )
4660 func testNumberOfSections( ) {
4761 presenter. viewDidLoad ( )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import UIKit
1010@testable import ICTMDBHomeModule
1111
1212final class MockHomeViewController : PresenterToViewHomeProtocol {
13+
1314
1415 // MARK: - Mock Functions
1516
@@ -19,6 +20,17 @@ final class MockHomeViewController: PresenterToViewHomeProtocol {
1920 invokedRelaodCollectionView = true
2021 invokedRelaodCollectionViewCount += 1
2122 }
23+
24+ var invokedSetNavigationTitle = false
25+ var invokedSetNavigationTitleCount = 0
26+ var invokedSetNavigationTitleData : [ ( title: String , ( ) ) ] = [ ]
27+ func setNavigationTitle( title: String ) {
28+ invokedSetNavigationTitle = true
29+ invokedSetNavigationTitleCount += 1
30+ invokedSetNavigationTitleData. append ( ( title: title, ( ) ) )
31+
32+ }
33+
2234
2335 var invokedSendError = false
2436 var invokedSendErrorCount = 0
You can’t perform that action at this time.
0 commit comments