Пример #1
0
        public FileEventListener(IFileMonitor fileMonitor, IOnChangeTaskDispatcher taskDispatcher, IGooseActionFactory actionFactory, IFileChangeSubscriber fileChangeSubscriber)
        {
            this.fileMonitor = fileMonitor;
            this.taskDispatcher = taskDispatcher;
            this.actionFactory = actionFactory;

            fileChangeSubscriber.Attach(this);
        }
        public DefaultFileEventListenerFactory(ISolutionFilesService solutionFilesService, IVsFileChangeEx fileChangeService, IOutputService outputService, ICommandErrorReporter errorReporter)
        {
            this.solutionFilesService = solutionFilesService;
            this.fileChangeService = fileChangeService;
            this.outputService = outputService;

            this.globMatcher = new RegexGlobMatcher();
            this.onChangeTaskDispatcher = new SynchronousOnChangeTaskDispatcher(this.outputService);
            this.actionFactory = new PowerShellGooseActionFactory(new PowerShellTaskFactory(this.outputService, errorReporter, new JsonCommandLogParser()), new PowerShellCommandBuilder());
        }
            public TestSubscriptionBuilder(IFileMonitor fileMonitor, FileEventListener changeConsumer, IGooseActionFactory actionFactory)
            {
                this.fileMonitor = fileMonitor;
                this.changeConsumer = changeConsumer;
                this.actionFactory = actionFactory;

                A.CallTo(() => this.actionFactory.Create(A<ActionConfiguration>._, A<IEnumerable<string>>._))
                    .WithAnyArguments()
                    .ReturnsLazily(call => ((IEnumerable<string>)call.Arguments[1]).Select(_ => A.Fake<IGooseAction>()));
            }