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

            folderStats.Connect(RootPath);
            Assert.AreEqual(Statuses.Connected, folderStats.Status);
        }
示例#2
0
文件: Tests.cs 项目: peitor/CodeKatas
        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);
        }
示例#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);
        }
示例#4
0
文件: Tests.cs 项目: peitor/CodeKatas
        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);
        }
示例#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);
        }
示例#6
0
文件: Tests.cs 项目: peitor/CodeKatas
 public void StatusAfterConnectIsConnected()
 {
     IFolderStats folderStats = new FolderStatsMock(fileSystem);
     folderStats.Connect(RootPath);
     Assert.AreEqual(Statuses.Connected, folderStats.Status);
 }