Пример #1
0
        public void TestGetSearchResults()
        {
            // Test 1: search metadata.
            MovieInfo info = new MovieInfo()
            {
                Name = "蝙蝠侠.黑暗骑士",
            };

            var result = _provider.GetSearchResults(info, CancellationToken.None).Result;

            Assert.NotEmpty(result);
            Assert.True(result.Count() > 1);
            string doubanId = result.FirstOrDefault()?.GetProviderId(BaseProvider.ProviderID);
            int?   year     = result.FirstOrDefault()?.ProductionYear;

            Assert.Equal("1851857", doubanId);
            Assert.Equal(2008, year);

            // Test 2: Already has provider Id.
            info.SetProviderId(BaseProvider.ProviderID, "1851857");
            result = _provider.GetSearchResults(info, CancellationToken.None).Result;
            Assert.True(result.Count() == 1);
            doubanId = result.FirstOrDefault()?.GetProviderId(BaseProvider.ProviderID);
            year     = result.FirstOrDefault()?.ProductionYear;
            Assert.Equal("1851857", doubanId);
            Assert.Equal(2008, year);
        }
Пример #2
0
        public void TestSearchMovie()
        {
            // Test 1: search metadata.
            MovieInfo info = new MovieInfo()
            {
                Name = "蝙蝠侠:黑暗骑士",
            };

            var result = _doubanProvider.GetSearchResults(info, CancellationToken.None).Result;

            Assert.NotEmpty(result);
        }