Esempio n. 1
0
        public async Task GetAudioStreamMonitoringInfoAsync_Returns_AudioStreamMonitoringInfo()
        {
            var wowzaResponse = new WowzaMonitorStreamResponse
            {
                Name   = "Name",
                Uptime = 1,
                ApplicationInstance = "ApplicationInstance",
                BytesIn             = 1,
                ServerName          = "ServerName",
                BytesInRate         = 1
            };

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

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

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

            response.Should().NotBeNull();
            response.Should().BeEquivalentTo(wowzaResponse, options => options.ExcludingMissingMembers());
        }
 public static AudioStreamMonitoringInfo MapToAudioStreamMonitoringInfo(WowzaMonitorStreamResponse response)
 {
     return(new AudioStreamMonitoringInfo
     {
         Name = response.Name,
         Uptime = response.Uptime,
         ApplicationInstance = response.ApplicationInstance,
         BytesIn = response.BytesIn,
         ServerName = response.ServerName,
         BytesInRate = response.BytesInRate
     });
 }