Skip to content

Navigator_ReplaceScreenInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.ReplaceScreenInvocation

Testing helper

struct ReplaceScreenInvocation: Hashable 

Example

 var invocations = [Navigator.ReplaceScreenInvocation]()
 let expectectedInvocations = [
   Navigator.ReplaceScreenInvocation(
    oldContent: oldContent.eraseToAnyScreen(),
    newContent: expectedContent.eraseToAnyScreen()
   )
 ]

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

 sut.replace(screen: oldContent, with: expectedContent) // invoke code that invokes dismissSuccessor(of:)

 XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

oldContent

let oldContent: AnyScreen

newContent

let newContent: AnyScreen
Clone this wiki locally