public void EventWorker_DeletesFileFromSvn_WhenFileIsDeletedFromDirectory()
        {
            _manager.Monitor(_testFolders);
            _manager.StartProcessing();

            var folder   = _testFolders[0];
            var fileName = TestFileSystemHelper.MakeUniqueFileName("css");

            DoAndWaitForWorker(() => TestFileSystemHelper.CreateFile(fileName, folder.Path));

            var filePath = folder.Path + "\\" + fileName;

            DoAndWaitForWorker(() => File.Delete(filePath));

            using (var client = new SvnClient()) {
                var status = GetSvnStatus(client, filePath);
                Assert.That(status, Is.EqualTo(SvnStatus.None));
            }
        }
        public void EventWorker_CommittsNewFileToSvn_WhenFileIsAdded()
        {
            _manager.Monitor(_testFolders);
            _manager.StartProcessing();

            var folder   = _testFolders[0];
            var fileName = TestFileSystemHelper.MakeUniqueFileName("css");

            using (var client = new SvnClient()) {
                SvnInfoEventArgs info;
                client.GetInfo(folder.RepositoryUrl, out info);
                var revisionBeforeAdd = info.Revision;

                DoAndWaitForWorker(() => TestFileSystemHelper.CreateFile(fileName, folder.Path));

                client.GetInfo(folder.RepositoryUrl, out info);
                var revisionAfterAdd = info.Revision;

                Assert.That(revisionAfterAdd, Is.EqualTo(revisionBeforeAdd + 1));
            }
        }
        public void EventWorker_CommitsChangeToSvn_WhenFileIsChanged()
        {
            _manager.Monitor(_testFolders);
            _manager.StartProcessing();

            var folder   = _testFolders[0];
            var fileName = TestFileSystemHelper.MakeUniqueFileName("css");

            DoAndWaitForWorker(() => TestFileSystemHelper.CreateFile(fileName, folder.Path));

            var filePath = folder.Path + "\\" + fileName;

            using (var client = new SvnClient()) {
                SvnInfoEventArgs info;
                client.GetInfo(folder.RepositoryUrl, out info);
                var revisionBeforeChange = info.Revision;

                DoAndWaitForWorker(() => File.AppendAllText(filePath, "Hello World"));

                client.GetInfo(folder.RepositoryUrl, out info);
                var revisionAfterChange = info.Revision;
                Assert.That(revisionAfterChange, Is.EqualTo(revisionBeforeChange + 1));
            }
        }