public void SearchEmby_Should_Return_Emby_Instance()
        {
            var mediaServer = new MediaServerUdpBroadcast
            {
                Id       = "azerty",
                Address  = "localhost",
                Name     = "mediaServer",
                Port     = 80,
                Protocol = 0
            };

            var mediaServerServiceMock = new Mock <IMediaServerService>();

            mediaServerServiceMock.Setup(x => x.SearchMediaServer(It.IsAny <ServerType>())).Returns(mediaServer);
            var controller = new MediaServerController(mediaServerServiceMock.Object, _mapper);
            var result     = controller.SearchMediaServer(0);

            var resultObject            = result.Should().BeOfType <OkObjectResult>().Subject.Value;
            var mediaServerUdpBroadcast = resultObject.Should().BeOfType <UdpBroadcastViewModel>().Subject;

            mediaServerUdpBroadcast.Address.Should().Be(mediaServer.Address);
            mediaServerUdpBroadcast.Port.Should().Be(mediaServer.Port);
            mediaServerUdpBroadcast.Protocol.Should().Be(mediaServer.Protocol);
            mediaServerUdpBroadcast.Id.Should().Be(mediaServer.Id);
            mediaServerUdpBroadcast.Name.Should().Be(mediaServer.Name);

            mediaServerServiceMock.Verify(x => x.SearchMediaServer(ServerType.Emby), Times.Once);
            controller.Dispose();
        }
        public void ConvertHttpIp()
        {
            var address        = "http://192.168.1.1:801";
            var broadcastModel = new MediaServerUdpBroadcast();

            broadcastModel.Address = address;

            broadcastModel.Protocol.Should().Be(1);
            broadcastModel.Address.Should().Be("192.168.1.1");
            broadcastModel.Port.Should().Be(801);
        }
        public void ConvertHttpsAddress()
        {
            var address        = "https://my.domain.com:8001";
            var broadcastModel = new MediaServerUdpBroadcast();

            broadcastModel.Address = address;

            broadcastModel.Protocol.Should().Be(0);
            broadcastModel.Address.Should().Be("my.domain.com");
            broadcastModel.Port.Should().Be(8001);
        }