Skip to content

Navigator_ReplacePathInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.ReplacePathInvocation

Testing helper

struct ReplacePathInvocation: Hashable 

Example

 var invocations = [Navigator.ReplacePathInvocation]()
 let expectectedInvocations = [
   Navigator.ReplacePathInvocation(path: [testScreen.eraseToAnyScreen()])
 ]

 let sut = Navigator.mock(
   path: { self.path },
   replacePath: { path in
     invocations.append(.init(path: path))
   }
 )

 sut.replace(path: [testScreen.eraseToAnyScreen()]) // invoke code that invokes goBack(to:)

 XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

path

let path: [AnyScreen]
Clone this wiki locally