Ejemplo n.º 1
0
 private StepResult CreateStepResult(int index, string[] lines)
 {
     StepResult stepResult = new StepResult();
     stepResult.Name = lines[++index].Trim();
     stepResult.ResultText = lines[++index].Trim();
     return stepResult;
 }
Ejemplo n.º 2
0
        //[Fact]
        //public void should_add_adornment_for_each_result()
        //{
        //    IAdornmentLayer mockLayer = MockRepository.GenerateMock<IAdornmentLayer>();
        //    IWpfTextView stubView = MockRepository.GenerateStub<IWpfTextView>();
        //    IWpfTextView stubTextLine = MockRepository.GenerateStub<IWpfTextView>();
        //    stubView.Stub(v => v.GetAdornmentLayer("EditorHighlighter")).Return(mockLayer);
        //    stubTextLine.Stub(l => l.Start).Return(new SnapshotPoint());
        //    stubTextLine.Stub(l => l.End).Return(new SnapshotPoint());
        //    stubView.Stub(v => v.TextViewLines).Return(new List<IWpfTextView> {stubTextLine});
        //    mockLayer.Expect(l => l.AddAdornment(AdornmentPositioningBehavior.TextRelative, null, null, null, null)).IgnoreArguments().Constraints(Is.Equal(AdornmentPositioningBehavior.TextRelative), Is.TypeOf(typeof(SnapshotSpan)), Is.Equal("ResultMarker"), Is.TypeOf(typeof (Image)), Is.Null());
        //    EditorHighlighter editor = new EditorHighlighter(stubView);
        //    editor.HighlightFeatureFileWithResults(CreateResults());
        //    mockLayer.VerifyAllExpectations();
        //}
        private List<FeatureResult> CreateResults()
        {
            var features = new List<FeatureResult>();

            FeatureResult result = new FeatureResult();

            ScenarioResult scenarioResult = new ScenarioResult();

            StepResult stepResult = new StepResult();
            stepResult.Name = "Test";
            stepResult.ResultText = "passed";

            scenarioResult.StepResults.Add(stepResult);

            result.ScenarioResults.Add(scenarioResult);

            features.Add(result);

            return features;
        }
Ejemplo n.º 3
0
 private void AddStepToErrorList(FeatureResult featureResult, ScenarioResult scenarioResult, StepResult stepResult)
 {
     try
     {
         ErrorListProvider errorProvider = GetErrorListProvider();
         ErrorTask error = new ErrorTask();
         error.Category = TaskCategory.BuildCompile;
         error.Text = string.Format("The step \"{0}\" failed in scenario \"{1}\" for the feature \"{2}\"", stepResult.Name, scenarioResult.Name, featureResult.Name);
         errorProvider.Tasks.Add(error);
     }
     catch (InvalidOperationException)
     { }
 }
Ejemplo n.º 4
0
 private void AddStepToTaskList(FeatureResult featureResult, ScenarioResult scenarioResult, StepResult stepResult)
 {
     try
     {
         TaskProvider taskProvider = GetTaskListProvider();
         Task task = new Task();
         task.Category = TaskCategory.User;
         task.Text = string.Format("The step \"{0}\" is pending in scenario \"{1}\" for the feature \"{2}\"", stepResult.Name, scenarioResult.Name, featureResult.Name);
         taskProvider.Tasks.Add(task);
     }
     catch (InvalidOperationException)
     { }
 }