Skip to content

Navigator_ReplaceContentInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.ReplaceContentInvocation

Testing helper

struct ReplaceContentInvocation: Hashable 

Example

 var invocations = [Navigator.ReplaceContentInvocation]()
 let expectectedInvocations = [
   Navigator.ReplaceContentInvocation(
    id: expectedID,
    newContent: expectedContent.eraseToAnyScreen()
   )
 ]

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

 sut.didAppear(id: expectedID) // invoke code that invokes dismissSuccessor(of:)

 XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

id

let id: ScreenID

newContent

let newContent: AnyScreen
Clone this wiki locally