Inheritance: MediaSoftwareService
Esempio n. 1
0
        private ITunesServiceImpl GetServiceInstance()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

            service.MediaSoftwareConnectionFactory = this.mockConnectionFactory;
            return(service);
        }
Esempio n. 2
0
        public void TestVersion()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();
            Assert.AreEqual("1.0", service.Version);
        }
Esempio n. 3
0
        public void TestInitializeFailsOnMoreThanOneCall()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();
            service.Initialize();
        }
Esempio n. 4
0
        public void TestInitialize()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

            service.MediaSoftwareConnectionFactory = mockConnectionFactory;
            service.Initialize();

            Assert.AreEqual(true, service.Initialized);
        }
Esempio n. 5
0
        public void GetPlaylist_ShouldReturNullWhenNoPlaylistWithTheGivenID()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();

            MockLibrarySource librarySource = CreateAndSetUpLibrarySource();

            mockITunesApp.LibrarySource = librarySource;

            Playlist playlist = service.GetPlaylist(42);

            Assert.Null(playlist);
        }
Esempio n. 6
0
        public void GetPlaylist_ShouldReturnPlaylistForTheGivenID()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();

            MockLibrarySource librarySource = CreateAndSetUpLibrarySource();

            mockITunesApp.LibrarySource = librarySource;

            Playlist playlist = service.GetPlaylist(2);

            Assert.NotNull(playlist);
            Assert.AreEqual(2, playlist.ID);
        }
Esempio n. 7
0
        public void TestGetPlaylists_always_returnsListWithPlaylistsEqualToThatReturnedFromITunes()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();

            MockLibrarySource librarySource = CreateAndSetUpLibrarySource();

            mockITunesApp.LibrarySource = librarySource;

            List <Playlist> playlists = service.GetPlaylists();

            Assert.AreEqual(2, playlists.Count);
            Assert.AreEqual("Playlist 1", playlists[0].Name);
            Assert.AreEqual("Playlist 2", playlists[1].Name);
        }
Esempio n. 8
0
 private void PopulateMediaSoftwareServices()
 {
     try
     {
         MediaSoftwareService itunesService = new ITunesServiceImpl();
         itunesService.MediaSoftwareConnectionFactory = new ITunesConnectionFactory();
         itunesService.Initialize();
         mediaSoftwareServices.Add(ITunesServiceImpl.SERVICE_NAME, itunesService);
     }
     catch (Exception ex)
     {
         l.Error("Failed to create iTunes API stub.", ex);
         MessageBox.Show(this, "I was unable to communicate with the iTunes interface. You will not be able to synchronize your devices with iTunes.", "Media Software Service initialization failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 9
0
        public void TestInitialize()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();
            service.MediaSoftwareConnectionFactory = mockConnectionFactory;
            service.Initialize();

            Assert.AreEqual(true, service.Initialized);
        }
Esempio n. 10
0
 private ITunesServiceImpl GetServiceInstance()
 {
     ITunesServiceImpl service = new ITunesServiceImpl();
     service.MediaSoftwareConnectionFactory = this.mockConnectionFactory;
     return service;
 }
Esempio n. 11
0
 public void TestInitializeValidatesRequiredFields()
 {
     ITunesServiceImpl service = new ITunesServiceImpl();
     service.Initialize();
 }
Esempio n. 12
0
 public void TestAccessingMethodsBeforeInitializeIsCalled()
 {
     ITunesServiceImpl service = GetServiceInstance();
     string            version = service.Version;
 }
Esempio n. 13
0
        public void TestInitializeValidatesRequiredFields()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

            service.Initialize();
        }