public void TestPodcastInitialization()
        {
            MockMediaLocation location = new MockMediaLocation("test.vodcast");
            location.Contents = "url : http://somewhere.com\n";
            location.Contents += "download_policy : FirstPlay\n";
            location.Contents += "files_to_retain : 10\n";

            VodCast vodcast = new VodCast();
            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.AreEqual(vodcast.Url, "http://somewhere.com");
            Assert.AreEqual(vodcast.DownloadPolicy, DownloadPolicy.FirstPlay);
            Assert.AreEqual(vodcast.FilesToRetain, 10);
        }
        public void TestPodcastFetching()
        {
            var backup = Kernel.Instance.MediaLocationFactory;

            MockMediaLocation location = new MockMediaLocation("test.vodcast");
            location.Contents = "url : http://www.abc.net.au/atthemovies/vodcast_wmv.xml";

            // our kernel needs to know how to retrieve our location.
            Kernel.Instance.MediaLocationFactory = new MockMediaLocationFactory(location);

            VodCast vodcast = new VodCast();
            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.IsTrue(vodcast.Children.Count > 0);

            Kernel.Instance.MediaLocationFactory = backup;
        }
        public void TestTEDPodcastFetching()
        {
            var backup = Kernel.Instance.MediaLocationFactory;

            MockMediaLocation location = new MockMediaLocation("test.vodcast");
            location.Contents = "url : http://feeds.feedburner.com/TedtalksHD?format=xml";

            // our kernel needs to know how to retrieve our location.
            Kernel.Instance.MediaLocationFactory = new MockMediaLocationFactory(location);

            VodCast vodcast = new VodCast();
            vodcast.Assign(location, null, Guid.NewGuid());

            Assert.IsTrue(vodcast.Children.Count > 0);

            Kernel.Instance.MediaLocationFactory = backup;
        }
        public void MovieResolverShouldIgnoreHiddenFiles()
        {
            MovieResolver resolver = new MovieResolver(2, true, true);

            var location = new MockMediaLocation("c:\\movie.avi");

            BaseItemFactory factory;
            IEnumerable<InitializationParameter> setup;
            resolver.ResolveEntity(location, out factory, out setup);

            Assert.IsNotNull(factory);

            location.Attributes = System.IO.FileAttributes.Hidden | System.IO.FileAttributes.System;

            resolver.ResolveEntity(location, out factory, out setup);

            Assert.IsNull(factory);
        }
Exemple #5
0
            public void AddSibling(RowInfo info)
            {
                MockMediaLocation newLocation;

                if (info.IsFolder)
                {
                    newLocation = new MockFolderMediaLocation();
                }
                else
                {
                    newLocation = new MockMediaLocation();
                }
                if (location.Path.Length > 0)
                {
                    newLocation.Path = location.Path + "\\" + info.Path;
                }
                else
                {
                    newLocation.Path = info.Path;
                }
                newLocation.Parent = this.location;
                location.Children.Add(newLocation);
            }
        public void TestNothingIsTruncatedWithDots()
        {
            var resolver = CreateResolver();
            var movieLocation =  new MockMediaLocation("c:\\Jackass 2.5.avi");

            BaseItemFactory factory;
            IEnumerable<InitializationParameter> setup;
            resolver.ResolveEntity(movieLocation, out factory, out setup);

            Movie movie = (Movie)factory.CreateInstance(movieLocation, setup);

            Assert.AreEqual(movie.Name, "Jackass 2.5");
        }
 public void AddSibling(RowInfo info)
 {
     MockMediaLocation newLocation;
     if (info.IsFolder) {
         newLocation = new MockFolderMediaLocation();
     } else {
         newLocation = new MockMediaLocation();
     }
     if (location.Path.Length > 0) {
         newLocation.Path = location.Path + "\\" + info.Path;
     } else {
         newLocation.Path = info.Path;
     }
     newLocation.Parent = this.location;
     location.Children.Add(newLocation);
 }