예제 #1
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());

            _userDataManager = userData.Object;
            _parser          = new MovieNfoParser(new NullLogger <MovieNfoParser>(), configManager.Object, providerManager.Object, user.Object, userData.Object);
        }
예제 #2
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);
        }
예제 #3
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);
        }