Наследование: MediaSoftwareService
Пример #1
0
        private ITunesServiceImpl GetServiceInstance()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

            service.MediaSoftwareConnectionFactory = this.mockConnectionFactory;
            return(service);
        }
Пример #2
0
        public void TestVersion()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();
            Assert.AreEqual("1.0", service.Version);
        }
Пример #3
0
        public void TestInitializeFailsOnMoreThanOneCall()
        {
            ITunesServiceImpl service = GetServiceInstance();

            service.Initialize();
            service.Initialize();
        }
Пример #4
0
        public void TestInitialize()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();

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

            Assert.AreEqual(true, service.Initialized);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
     }
 }
Пример #9
0
        public void TestInitialize()
        {
            ITunesServiceImpl service = new ITunesServiceImpl();
            service.MediaSoftwareConnectionFactory = mockConnectionFactory;
            service.Initialize();

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

            service.Initialize();
        }