public virtual void before_each() { autoSubstitute = new AutoSubstitute(); solutionOpenedStream = new Subject <SolutionInfo>(); solutionClosingStream = new Subject <Unit>(); projectAddedStream = new Subject <ProjectInfo>(); projectRemovingtream = new Subject <ProjectInfo>(); var solutionNotifier = autoSubstitute.Resolve <ISolutionNotifier>(); solutionNotifier.SolutionOpenedStream.Returns(solutionOpenedStream); solutionNotifier.SolutionClosingStream.Returns(solutionClosingStream); solutionNotifier.ProjectAddedStream.Returns(projectAddedStream); solutionNotifier.ProjectRemovingtream.Returns(projectRemovingtream); projectEnumerator = autoSubstitute.Resolve <IProjectEnumerator>(); notifier = autoSubstitute.Resolve <ProjectNotifier>(); testProjectObserver = new TestScheduler().CreateObserver <IEnumerable <ProjectInfo> >(); subscription = notifier.ProjectStream.Subscribe(testProjectObserver); someSolution = new SolutionInfo(); someProjectInfos = new [] { new ProjectInfo(), new ProjectInfo(), new ProjectInfo(), }; }
public void OnExecute(CommandEventArgs e) { if (_commandService == null) _commandService = e.GetService<IVisualGitCommandService>(); if (_projectNotifier == null) _projectNotifier = e.GetService<ProjectNotifier>(typeof(IFileStatusMonitor)); _commandService.TockCommand(e.Command); _projectNotifier.HandleEvent(e.Command); }
public void OnExecute(CommandEventArgs e) { if (_commandService == null) { _commandService = e.GetService <IAnkhCommandService>(); } if (_projectNotifier == null) { _projectNotifier = e.GetService <ProjectNotifier>(typeof(IFileStatusMonitor)); } _commandService.TockCommand(e.Command); _projectNotifier.HandleEvent(e.Command); }