Skip to content

Navigator_GoToPathInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.GoToPathInvocation

Testing helper

struct GoToPathInvocation: Hashable 

Example

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

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

sut.go(to: [testScreen.eraseToAnyScreen()], on: parent) // invoke code that invokes go(to path:, on id:)

XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

path

let path: [AnyScreen]

on

let on: NavigationIdentifier
Clone this wiki locally