public void EnableTraktScrobbleHandlerWhenSettingsChanged()
        {
            // Arrange
            IMediaPortalServices mediaPortalServices = Substitute.For <IMediaPortalServices>();

            mediaPortalServices.GetTraktUserHomePath().Returns(DataPath);
            TraktPluginSettings settings = new TraktPluginSettings
            {
                IsScrobbleEnabled = false
            };
            ITraktSettingsChangeWatcher settingsChangeWatcher = Substitute.For <ITraktSettingsChangeWatcher>();

            settingsChangeWatcher.TraktSettings.Returns(settings);
            mediaPortalServices.GetTraktSettingsWatcher().Returns(settingsChangeWatcher);

            ISettingsManager settingsManager = Substitute.For <ISettingsManager>();

            settingsManager.Load <TraktPluginSettings>().Returns(settings);
            mediaPortalServices.GetSettingsManager().Returns(settingsManager);

            ITraktClient    traktClient    = Substitute.For <ITraktClient>();
            IFileOperations fileOperations = Substitute.For <IFileOperations>();

            fileOperations.FileExists(Path.Combine(DataPath, FileName.Authorization.Value)).Returns(true);

            TraktScrobbleHandlerManager traktScrobbleHandler = new TraktScrobbleHandlerManager(mediaPortalServices, traktClient, fileOperations);

            // Act
            settings.IsScrobbleEnabled = true;
            settingsChangeWatcher.TraktSettingsChanged += Raise.Event();

            // Assert
            Assert.True(traktScrobbleHandler.IsActive);
        }
        private void SetSettings(IMediaPortalServices mediaPortalServices, TraktPluginSettings settings)
        {
            ITraktSettingsChangeWatcher settingsChangeWatcher = Substitute.For <ITraktSettingsChangeWatcher>();

            settingsChangeWatcher.TraktSettings.Returns(settings);
            mediaPortalServices.GetTraktSettingsWatcher().Returns(settingsChangeWatcher);

            ISettingsManager settingsManager = Substitute.For <ISettingsManager>();

            settingsManager.Load <TraktPluginSettings>().Returns(settings);
            mediaPortalServices.GetSettingsManager().Returns(settingsManager);
        }