Beispiel #1
0
        public async Task GetRecordingStateAsync_Return200Ok(string sampleRecordingId)
        {
            ServerCall serverCall = CreateMockServerCall(200, responseContent: DummyRecordingStateResponse);

            Response <CallRecordingProperties> result = await serverCall.GetRecordingStateAsync(sampleRecordingId);

            Assert.AreEqual(CallRecordingState.Active, result.Value.RecordingState);
        }
Beispiel #2
0
        protected async Task ValidateCallRecordingStateAsync(ServerCall serverCall,
                                                             string recordingId,
                                                             CallRecordingState expectedCallRecordingState)
        {
            Assert.NotNull(serverCall);
            Assert.NotNull(recordingId);

            // There is a delay between the action and when the state is available.
            // Waiting to make sure we get the updated state, when we are running
            // against a live service.
            SleepInTest(6000);

            CallRecordingProperties callRecordingProperties = await serverCall.GetRecordingStateAsync(recordingId).ConfigureAwait(false);

            Assert.NotNull(callRecordingProperties);
            Assert.AreEqual(callRecordingProperties.RecordingState, expectedCallRecordingState);
        }
Beispiel #3
0
        public void GetRecordingStateAsync_Returns404NotFound(string sampleRecordingId)
        {
            ServerCall serverCall = CreateMockServerCall(404);

            RequestFailedException?ex = Assert.ThrowsAsync <RequestFailedException>(async() => await serverCall.GetRecordingStateAsync(sampleRecordingId).ConfigureAwait(false));

            Assert.NotNull(ex);
            Assert.AreEqual(ex?.Status, 404);
        }