Пример #1
0
        public void Runs_nothing_when_nothing_was_selected()
        {
            fixSelection.SetSelected(null);

            fixSelection.InvokeHidden();

            selectedTask.AssertWasNotCalled(t => t.Run(Arg <RefactoringOptions> .Is.Anything));
        }
Пример #2
0
        public void Doesnt_run_directly_any_valid_task_when_more_than_one_valid_task_found()
        {
            provider.Stub(p => p.GetPossibleRefactoring()).Return(new List <IRefactorTask> {
                validTask, anotherValidTask, invalidTask
            }).Repeat.Once();

            subject.Update();
            subject.Run();

            validTask.AssertWasCalled(t => t.IsValid());
            validTask.AssertWasNotCalled(t => t.Run(Arg <RefactoringOptions> .Is.Anything));
            anotherValidTask.AssertWasNotCalled(t => t.Run(Arg <RefactoringOptions> .Is.Anything));
        }