public void StatusAfterConnectIsConnected() { IFolderStats folderStats = new FolderStatsMock(fileSystem); folderStats.Connect(RootPath); Assert.AreEqual(Statuses.Connected, folderStats.Status); }
public void DirectoryWith2Subfolders_WhenPauseCalled_StatusPaused() { var root = GivenDirectory("c:\temp\test001"); root.SubDirectories.Add(new DirectoryMock("1")); root.SubDirectories.Add(new DirectoryMock("2")); IFolderStats folderStats = new FolderStatsMock(fileSystem); folderStats.Progress += folder => { Thread.Sleep(100); }; folderStats.Connect(root.Name); folderStats.Start(); folderStats.Pause(); Assert.AreEqual(Statuses.Paused, folderStats.Status); }
public void EmptyDirectory_RaisesProgress() { var root = GivenDirectory("c:\temp\test001"); IFolderStats folderStats = new FolderStatsMock(fileSystem); var counter = 0; var resetEvent = new AutoResetEvent(false); folderStats.Progress += folder => { counter++; resetEvent.Set(); }; folderStats.Connect(root.Name); folderStats.Start(); resetEvent.WaitOne(1000); Assert.AreEqual(1, counter); }