예제 #1
0
        public async Task GetAudioStreamInfoAsync_Returns_AudioStreamInfoResponse()
        {
            var wowzaResponse = new WowzaGetStreamRecorderResponse
            {
                Option              = "Option",
                ApplicationName     = "ApplicationName",
                BaseFile            = "BaseFile",
                CurrentDuration     = 1,
                CurrentFile         = "CurrentFile",
                CurrentSize         = 1,
                FileFormat          = "FileFormat",
                InstanceName        = "InstanceName",
                OutputPath          = "OutputPath",
                RecorderName        = "RecorderName",
                RecorderState       = "RecorderState",
                SegmentDuration     = 1,
                ServerName          = "ServerName",
                RecorderErrorString = "RecorderErrorString",
                RecordingStartTime  = "RecordingStartTime"
            };

            _audioPlatformService
            .Setup(x => x.GetAudioStreamInfoAsync(It.IsAny <Guid>()))
            .ReturnsAsync(wowzaResponse);

            var result = await _controller.GetAudioStreamInfoAsync(It.IsAny <Guid>()) as OkObjectResult;

            result.Should().NotBeNull();
            result.StatusCode.Should().Be(StatusCodes.Status200OK);
            var response = result.Value as AudioStreamInfoResponse;

            response.Should().NotBeNull();
            response.Should().BeEquivalentTo(wowzaResponse, options => options.ExcludingMissingMembers());
        }
 public static AudioStreamInfoResponse MapToAudioStreamInfo(WowzaGetStreamRecorderResponse response)
 {
     return(new AudioStreamInfoResponse
     {
         Option = response.Option,
         ApplicationName = response.ApplicationName,
         BaseFile = response.BaseFile,
         CurrentDuration = response.CurrentDuration,
         CurrentFile = response.CurrentFile,
         CurrentSize = response.CurrentSize,
         FileFormat = response.FileFormat,
         InstanceName = response.InstanceName,
         OutputPath = response.OutputPath,
         RecorderName = response.RecorderName,
         RecorderState = response.RecorderState,
         SegmentDuration = response.SegmentDuration,
         ServerName = response.ServerName,
         RecorderErrorString = response.RecorderErrorString,
         RecordingStartTime = response.RecordingStartTime
     });
 }