public async Task GetServerInfo_Should_Return_Emby_Server_Info_And_Fetch_It_From_Emby()
        {
            _httpClientMock      = new Mock <IHttpClient>();
            _embyRepositoryMock  = new Mock <IMediaServerRepository>();
            _movieRepositoryMock = new Mock <IMovieRepository>();
            _showRepositoryMock  = new Mock <IShowRepository>();
            _embyRepositoryMock  = new Mock <IMediaServerRepository>();
            _sessionServiceMock  = new Mock <ISessionService>();

            _embyRepositoryMock.Setup(x => x.GetServerInfo()).Returns((ServerInfo)null);
            _embyRepositoryMock.Setup(x => x.UpsertServerInfo(It.IsAny <ServerInfo>()));

            var serverInfo = new ServerInfo {
                Id = Guid.NewGuid().ToString()
            };

            _httpClientMock.Setup(x => x.GetServerInfo()).Returns(serverInfo);

            var strategy = new Mock <IClientStrategy>();

            strategy.Setup(x => x.CreateHttpClient(It.IsAny <ServerType>())).Returns(_httpClientMock.Object);

            var libraryRepository = new Mock <ILibraryRepository>();
            var service           = new MediaServerService(strategy.Object, _embyRepositoryMock.Object, _sessionServiceMock.Object, _settingsServiceMock.Object, _movieRepositoryMock.Object, _showRepositoryMock.Object, libraryRepository.Object);
            var result            = service.GetServerInfo(false);

            result.Should().NotBeNull();
            result.Id.Should().Be(serverInfo.Id);

            _embyRepositoryMock.Verify(x => x.GetServerInfo(), Times.Once);
            _embyRepositoryMock.Verify(x => x.UpsertServerInfo(It.IsAny <ServerInfo>()), Times.Once);
            _httpClientMock.Verify(x => x.GetServerInfo(), Times.Once);
        }
        public void GetServerInfo_Should_Return_Emby_Server_Info()
        {
            _httpClientMock      = new Mock <IHttpClient>();
            _embyRepositoryMock  = new Mock <IMediaServerRepository>();
            _movieRepositoryMock = new Mock <IMovieRepository>();
            _showRepositoryMock  = new Mock <IShowRepository>();
            _embyRepositoryMock  = new Mock <IMediaServerRepository>();
            _sessionServiceMock  = new Mock <ISessionService>();

            var serverInfo = new ServerInfo {
                Id = "1234"
            };

            _embyRepositoryMock.Setup(x => x.GetServerInfo()).Returns(serverInfo);

            var strategy = new Mock <IClientStrategy>();

            strategy.Setup(x => x.CreateHttpClient(It.IsAny <ServerType>())).Returns(_httpClientMock.Object);

            var libraryRepository = new Mock <ILibraryRepository>();
            var service           = new MediaServerService(strategy.Object, _embyRepositoryMock.Object, _sessionServiceMock.Object, _settingsServiceMock.Object, _movieRepositoryMock.Object, _showRepositoryMock.Object, libraryRepository.Object);
            var result            = service.GetServerInfo(false);

            result.Should().NotBeNull();
            result.Id.Should().Be(serverInfo.Id);

            _embyRepositoryMock.Verify(x => x.GetServerInfo(), Times.Once);
        }