Beispiel #1
0
        public void StartRecordingLatestVersion_Returns200Ok(Uri sampleCallBackUri, RecordingContentType?recordingContentType, RecordingChannelType recordingChannelType, RecordingFormatType recordingFormatType)
        {
            ServerCall serverCall = CreateMockServerCall(200, responseContent: DummyStartRecordingResponse);

            StartCallRecordingResult result = serverCall.StartRecording(sampleCallBackUri, recordingContentType, recordingChannelType, recordingFormatType);

            Assert.AreEqual("dummyRecordingId", result.RecordingId);
        }
Beispiel #2
0
        public void StartRecordingLatestVersion_Returns404NotFound(Uri sampleCallBackUri, RecordingContentType?recordingContentType, RecordingChannelType recordingChannelType, RecordingFormatType recordingFormatType)
        {
            ServerCall serverCall = CreateMockServerCall(404);

            RequestFailedException?ex = Assert.Throws <RequestFailedException>(() => serverCall.StartRecording(sampleCallBackUri, recordingContentType, recordingChannelType, recordingFormatType));

            Assert.NotNull(ex);
            Assert.AreEqual(ex?.Status, 404);
        }
Beispiel #3
0
        internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFileStatusUpdatedEventData(JsonElement element)
        {
            Optional <AcsRecordingStorageInfoProperties> recordingStorageInfo = default;
            Optional <DateTimeOffset>       recordingStartTime   = default;
            Optional <long>                 recordingDurationMs  = default;
            Optional <RecordingContentType> recordingContentType = default;
            Optional <RecordingChannelType> recordingChannelType = default;
            Optional <RecordingFormatType>  recordingFormatType  = default;
            Optional <string>               sessionEndReason     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recordingStorageInfo"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingStorageInfo = AcsRecordingStorageInfoProperties.DeserializeAcsRecordingStorageInfoProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("recordingStartTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingStartTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("recordingDurationMs"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingDurationMs = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("recordingContentType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingContentType = new RecordingContentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("recordingChannelType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingChannelType = new RecordingChannelType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("recordingFormatType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recordingFormatType = new RecordingFormatType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("sessionEndReason"))
                {
                    sessionEndReason = property.Value.GetString();
                    continue;
                }
            }
            return(new AcsRecordingFileStatusUpdatedEventData(recordingStorageInfo.Value, Optional.ToNullable(recordingStartTime), Optional.ToNullable(recordingDurationMs), Optional.ToNullable(recordingContentType), Optional.ToNullable(recordingChannelType), Optional.ToNullable(recordingFormatType), sessionEndReason.Value));
        }