예제 #1
0
            public Delay50MsNoFiltering()
            {
                _fileSystem = Substitute.For <IFileSystem>();
                var watchers = GetWatchersFromMsBuildFileSystemWatcher(_fileSystem);

                _fileSystemFilter = Substitute.For <IMsBuildFileSystemFilter>();
                _fileSystemFilter.IsFileAllowed(Arg.Any <string>(), Arg.Any <FileAttributes>()).ReturnsForAnyArgs(true);
                _fileSystemFilter.IsDirectoryAllowed(Arg.Any <string>(), Arg.Any <FileAttributes>()).ReturnsForAnyArgs(true);

                _taskScheduler = new ControlledTaskScheduler(SynchronizationContext.Current);

                _fileSystemWatcher = new MsBuildFileSystemWatcher(ProjectDirectory, "*", 50, 50, _fileSystem, _fileSystemFilter, Substitute.For <IActionLog>(), _taskScheduler);
                _taskScheduler.Link(_fileSystemWatcher.SourceBlock, c => { _changeset = c; });

                _fileSystemWatcher.Start();
                _fileWatcher       = watchers.FileWatcher;
                _directoryWatcher  = watchers.DirectoryWatcher;
                _attributesWatcher = watchers.AttributesWatcher;
            }
            public async Task InitializeAsync()
            {
                await _taskScheduler;

                _taskScheduler.Link(_fileSystemWatcher.SourceBlock, c => { _changeset = c; });
            }