public MovieNfoParserTests()
        {
            _testUser = new User("Test User", "Auth provider", "Reset provider");

            var providerManager = new Mock <IProviderManager>();

            var tmdbExternalId = new TmdbMovieExternalId();
            var externalIdInfo = new ExternalIdInfo(tmdbExternalId.ProviderName, tmdbExternalId.Key, tmdbExternalId.Type, tmdbExternalId.UrlFormatString);

            providerManager.Setup(x => x.GetExternalIdInfos(It.IsAny <IHasProviderIds>()))
            .Returns(new[] { externalIdInfo });

            var nfoConfig = new XbmcMetadataOptions()
            {
                UserId = "F38E6443-090B-4F7A-BD12-9CFF5020F7BC"
            };
            var configManager = new Mock <IConfigurationManager>();

            configManager.Setup(x => x.GetConfiguration(It.IsAny <string>()))
            .Returns(nfoConfig);

            var user = new Mock <IUserManager>();

            user.Setup(x => x.GetUserById(It.IsAny <Guid>()))
            .Returns(_testUser);

            var userData = new Mock <IUserDataManager>();

            userData.Setup(x => x.GetUserData(_testUser, It.IsAny <BaseItem>()))
            .Returns(new UserItemData());

            _userDataManager = userData.Object;
            _parser          = new MovieNfoParser(new NullLogger <MovieNfoParser>(), configManager.Object, providerManager.Object, user.Object, userData.Object);
        }
Beispiel #2
0
        public MovieNfoParserTests()
        {
            var providerManager = new Mock <IProviderManager>();

            providerManager.Setup(x => x.GetExternalIdInfos(It.IsAny <IHasProviderIds>()))
            .Returns(Enumerable.Empty <ExternalIdInfo>());
            var config = new Mock <IConfigurationManager>();

            config.Setup(x => x.GetConfiguration(It.IsAny <string>()))
            .Returns(new XbmcMetadataOptions());
            _parser = new MovieNfoParser(new NullLogger <MovieNfoParser>(), config.Object, providerManager.Object);
        }
Beispiel #3
0
        public MovieNfoParserTests()
        {
            _testUser = new User("Test User", "Auth provider", "Reset provider");

            var providerManager = new Mock <IProviderManager>();

            var tmdbExternalId = new TmdbMovieExternalId();
            var externalIdInfo = new ExternalIdInfo(tmdbExternalId.ProviderName, tmdbExternalId.Key, tmdbExternalId.Type, tmdbExternalId.UrlFormatString);

            providerManager.Setup(x => x.GetExternalIdInfos(It.IsAny <IHasProviderIds>()))
            .Returns(new[] { externalIdInfo });

            var nfoConfig = new XbmcMetadataOptions()
            {
                UserId = "F38E6443-090B-4F7A-BD12-9CFF5020F7BC"
            };
            var configManager = new Mock <IConfigurationManager>();

            configManager.Setup(x => x.GetConfiguration(It.IsAny <string>()))
            .Returns(nfoConfig);

            var user = new Mock <IUserManager>();

            user.Setup(x => x.GetUserById(It.IsAny <Guid>()))
            .Returns(_testUser);

            var userData = new Mock <IUserDataManager>();

            userData.Setup(x => x.GetUserData(_testUser, It.IsAny <BaseItem>()))
            .Returns(new UserItemData());

            var directoryService = new Mock <IDirectoryService>();

            _localImageFileMetadata = new FileSystemMetadata()
            {
                Exists   = true,
                FullName = OperatingSystem.IsWindows() ?
                           "C:\\media\\movies\\Justice League (2017).jpg"
                    : "/media/movies/Justice League (2017).jpg"
            };
            directoryService.Setup(x => x.GetFile(_localImageFileMetadata.FullName))
            .Returns(_localImageFileMetadata);

            _userDataManager = userData.Object;
            _parser          = new MovieNfoParser(
                new NullLogger <MovieNfoParser>(),
                configManager.Object,
                providerManager.Object,
                user.Object,
                userData.Object,
                directoryService.Object);
        }
Beispiel #4
0
        public MovieNfoParserTests()
        {
            var providerManager = new Mock <IProviderManager>();

            var tmdbExternalId = new TmdbMovieExternalId();
            var externalIdInfo = new ExternalIdInfo(tmdbExternalId.ProviderName, tmdbExternalId.Key, tmdbExternalId.Type, tmdbExternalId.UrlFormatString);

            providerManager.Setup(x => x.GetExternalIdInfos(It.IsAny <IHasProviderIds>()))
            .Returns(new[] { externalIdInfo });

            var config = new Mock <IConfigurationManager>();

            config.Setup(x => x.GetConfiguration(It.IsAny <string>()))
            .Returns(new XbmcMetadataOptions());
            _parser = new MovieNfoParser(new NullLogger <MovieNfoParser>(), config.Object, providerManager.Object);
        }
        public MusicVideoNfoParserTests()
        {
            var providerManager = new Mock <IProviderManager>();

            providerManager.Setup(x => x.GetExternalIdInfos(It.IsAny <IHasProviderIds>()))
            .Returns(Enumerable.Empty <ExternalIdInfo>());
            var config = new Mock <IConfigurationManager>();

            config.Setup(x => x.GetConfiguration(It.IsAny <string>()))
            .Returns(new XbmcMetadataOptions());

            var user             = new Mock <IUserManager>();
            var userData         = new Mock <IUserDataManager>();
            var directoryService = new Mock <IDirectoryService>();

            _parser = new MovieNfoParser(
                new NullLogger <BaseNfoParser <MusicVideo> >(),
                config.Object,
                providerManager.Object,
                user.Object,
                userData.Object,
                directoryService.Object);
        }