CheckIfiTunesLibrary() публичный Метод

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
Результат bool
Пример #1
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:\\"));
        }
Пример #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:\\"));
            
        }