Skip to content

Navigator_GoToInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.GoToInvocation

Testing helper

struct GoToInvocation: Hashable 

Example

var invocations = [Navigator.GoToInvocation]()
let expectectedInvocations = [
  Navigator.GoToInvocation(screen: testScreen.eraseToAnyScreen(), on: .screen(parent.eraseToAnyScreen()))
]

let navigator = Navigator.mock(
  path: { self.path },
  goTo: { screen, id in
    invocations.append(.init(screen: screen, on: id))
  }
)

navigator.go(to: testScreen, on: parent) // invoke code that invokes go(to:, on id:)

XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

screen

let screen: AnyScreen

on

let on: NavigationIdentifier
Clone this wiki locally