Exemple #1
0
        public void StatusAfterConnectIsConnected()
        {
            IFolderStats folderStats = new FolderStatsMock(fileSystem);

            folderStats.Connect(RootPath);
            Assert.AreEqual(Statuses.Connected, folderStats.Status);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 public void StatusAfterConnectIsConnected()
 {
     IFolderStats folderStats = new FolderStatsMock(fileSystem);
     folderStats.Connect(RootPath);
     Assert.AreEqual(Statuses.Connected, folderStats.Status);
 }