public void TestFileHandlerException1() { var fileHandler = new FileHandler(); var args = new FiltrationArgs { From = "C:/NonExistingFile1.txt", To = "F:/NonExistingFile2.txt", Removing = false, Length = 0, ProcessID = 0 }; try { fileHandler.Filter(args); Assert.IsTrue(false); } catch (Exception e) { Assert.IsTrue(true); } }
public void TestFileHandlerException2() { var fileHandler = new FileHandler(); var args = new FiltrationArgs { From = "C:/Over32GBSizefile.txt", To = "DRIVE4GB:/To.txt", Removing = false, Length = 0, ProcessID = 0 }; try { fileHandler.Filter(args); Assert.IsTrue(false); } catch (Exception e) { Assert.IsTrue(true); } }
public void AddProcess() { int id = m_processes.Count; string title = "Converting " + From + " to " + To; var processData = new ProcessData() { Title = title, Percentage = 0, IsDone = false, ID = id }; lock (m_processesLock) m_processes.Add(id, processData); RaisePropertyChanged("Processes"); var args = new FiltrationArgs() { From = this.From, To = this.To, Length = this.Length, Removing = this.Removing, ProcessID = id }; ThreadPool.QueueUserWorkItem(Filter, args); }