I am creating a test case, which tests if the delegate function didDisconnectwithError can be called, for TVIroom class. for that I need to pass the delegate function a blankempty TVI room object. However the delegate function does not accept nil values as inputs, and forced unwrapping is not allowed. How do I pass a TVIroom object to the delegate for testing, if it can't be nil? here is my code so far:
func testDisconnectCalled_usedWhileSwitching_AndwhileExplicitlyDisconnecting() {
let delegate = RoomTestsDelegate()
let room: TVIRoom? = nil
let error: Error? = nil
delegate.room(room, didDisconnectWithError: error)
expect(delegate.notifiedAboutDidDisconnect).toEventually(beTrue(), timeout: 1)
}