No XCTest posso usar expectation(forNotification:)
para testar notificações de postagem do NSNotificationCenter como:
func testLoginNotification() {
let notificationExpectation = expectation(forNotification: .login, object: nil, handler: nil)
methodPostNotificationLogin()
wait(for: [notificationExpectation], timeout: 2)
}
Como fazer isso em testes rápidos?
@Test fun loginNotification() {
#expect()
}