func testStart_failedToStart()

in AmazonChimeSDK/AmazonChimeSDKTests/internal/audio/DefaultAudioClientControllerTests.swift [321:371]


    func testStart_failedToStart() {
        DefaultAudioClientController.state = .initialized
        given(audioClientMock.startSession(any(),
                                           basePort: any(),
                                           callId: any(),
                                           profileId: any(),
                                           microphoneMute: any(),
                                           speakerMute: any(),
                                           isPresenter: any(),
                                           sessionToken: any(),
                                           audioWsUrl: any(),
                                           callKitEnabled: any(),
                                           appInfo: any(),
                                           audioMode: any(),
                                           audioDeviceCapabilities: any(),
                                           enableAudioRedundancy: any(),
                                           reconnectTimeoutMs: any())).willReturn(AUDIO_CLIENT_ERR)
        given(audioClientObserverMock.audioStatus).willReturn(.ok)
        

        XCTAssertThrowsError(try defaultAudioClientController.start(audioFallbackUrl: audioFallbackUrl,
                                                                    audioHostUrl: audioHostUrlWithPort,
                                                                    meetingId: meetingId,
                                                                    attendeeId: attendeeId,
                                                                    joinToken: joinToken,
                                                                    callKitEnabled: callKitEnabled,
                                                                    audioMode: .stereo48K,
                                                                    audioDeviceCapabilities: .inputAndOutput,
                                                                    enableAudioRedundancy: true,
                                                                    reconnectTimeoutMs: self.reconnectTimeoutMs))
        verify(audioLockMock.lock()).wasCalled()
        verify(audioClientObserverMock.notifyAudioClientObserver(observerFunction: any())).wasCalled()
        verify(audioClientMock.startSession(self.audioHostUrl,
                                            basePort: 1820,
                                            callId: self.meetingId,
                                            profileId: self.attendeeId,
                                            microphoneMute: false,
                                            speakerMute: false,
                                            isPresenter: true,
                                            sessionToken: self.joinToken,
                                            audioWsUrl: self.audioFallbackUrl,
                                            callKitEnabled: false,
                                            appInfo: any(),
                                            audioMode: .Stereo48K,
                                            audioDeviceCapabilities: .InputAndOutput,
                                            enableAudioRedundancy: true,
                                            reconnectTimeoutMs: self.reconnectTimeoutMs)).wasCalled()
        XCTAssertEqual(.initialized, DefaultAudioClientController.state)
        verify(audioLockMock.unlock()).wasCalled()
        verify(eventAnalyticsControllerMock.publishEvent(name: .meetingStartFailed, attributes: [EventAttributeName.meetingStatus: any()])).wasCalled()
    }