Inheritance: MediaSoftwareService
Exemple #1
0
        private ITunesServiceImpl GetServiceInstance()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

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

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

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

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

            Assert.AreEqual(true, service.Initialized);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
     }
 }
        public void TestInitialize()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();
            service.MediaSoftwareConnectionFactory = mockConnectionFactory;
            service.Initialize();

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

            service.Initialize();
        }