CheckIfiTunesLibrary() public méthode

Check if device drive may be iTunes library folder. This could happen in case the user misconfigure the device and this check should help prevent loss of data.
public CheckIfiTunesLibrary ( string drive ) : bool
drive string
Résultat bool
        public void CheckIfITunesLibrary_whenNetworkDrive_correctlyChecksPath()
        {
            var appFactory = MockRepository.GenerateStub <ITunesAppFactory>();
            var mockITunes = MockRepository.GenerateStub <iTunesApp>();

            appFactory.Stub(x => x.GetNewInstance()).Return(mockITunes);

            mockITunes.Stub(x => x.Version).Return("Test");
            mockITunes.Stub(x => x.LibraryXMLPath).Return("\\\\networkdrive");

            MainForm form = new MainForm();

            form.ITunesAppFactory = appFactory;
            form.SetITunesInstance();
            Assert.IsFalse(form.CheckIfiTunesLibrary("E:\\"));
        }
Exemple #2
0
        public void CheckIfITunesLibrary_whenNetworkDrive_correctlyChecksPath()
        {

        	var appFactory = MockRepository.GenerateStub<ITunesAppFactory>();
        	var mockITunes = MockRepository.GenerateStub<iTunesApp>();
        	
        	appFactory.Stub(x => x.GetNewInstance()).Return(mockITunes);
        	
        	mockITunes.Stub(x => x.Version).Return("Test");
        	mockITunes.Stub(x => x.LibraryXMLPath).Return("\\\\networkdrive");
        	
        	MainForm form = new MainForm();
        	form.ITunesAppFactory = appFactory;
        	form.SetITunesInstance();
            Assert.IsFalse(form.CheckIfiTunesLibrary("E:\\"));
            
        }