use of com.thoughtworks.gauge.language.psi.impl.SpecStepImpl in project Intellij-Plugin by getgauge.
the class ReferenceSearchHelperTest method testGetReferenceElements.
@Test
public void testGetReferenceElements() throws Exception {
SpecStepImpl element = mock(SpecStepImpl.class);
when(element.getProject()).thenReturn(project);
StepValue stepValue = new StepValue("hello", "", new ArrayList<>());
ReferencesSearch.SearchParameters searchParameters = new ReferencesSearch.SearchParameters(element, scope, true);
when(element.getStepValue()).thenReturn(stepValue);
ReferenceSearchHelper referenceSearchHelper = new ReferenceSearchHelper();
referenceSearchHelper.getPsiElements(collector, searchParameters.getElementToSearch());
verify(collector, times(1)).get("hello");
}
use of com.thoughtworks.gauge.language.psi.impl.SpecStepImpl in project Intellij-Plugin by getgauge.
the class StepAnnotatorTest method testShouldAnnotateBlankSpecStep.
@Test
public void testShouldAnnotateBlankSpecStep() throws Exception {
SpecStepImpl element = mock(SpecStepImpl.class);
when(helper.isGaugeModule(element)).thenReturn(true);
when(helper.isEmpty(element)).thenReturn(true);
when(element.getTextRange()).thenReturn(textRange);
new StepAnnotator(helper).annotate(element, holder);
verify(holder, times(1)).createErrorAnnotation(textRange, "Step should not be blank");
}
use of com.thoughtworks.gauge.language.psi.impl.SpecStepImpl in project Intellij-Plugin by getgauge.
the class StepAnnotatorTest method testShouldNotAnnotateInNonGaugeModule.
@Test
public void testShouldNotAnnotateInNonGaugeModule() throws Exception {
SpecStepImpl element = mock(SpecStepImpl.class);
when(helper.isGaugeModule(element)).thenReturn(false);
new StepAnnotator(helper).annotate(element, holder);
verify(holder, never()).createErrorAnnotation(any(TextRange.class), any(String.class));
}
use of com.thoughtworks.gauge.language.psi.impl.SpecStepImpl in project Intellij-Plugin by getgauge.
the class StepAnnotatorTest method testShouldAnnotateInGaugeModule.
@Test
public void testShouldAnnotateInGaugeModule() throws Exception {
SpecStepImpl element = mock(SpecStepImpl.class);
Module module = mock(Module.class);
when(helper.isGaugeModule(element)).thenReturn(true);
when(element.getTextRange()).thenReturn(textRange);
when(helper.getModule(element)).thenReturn(module);
when(helper.isEmpty(element)).thenReturn(false);
when(helper.isImplemented(element, module)).thenReturn(false);
when(holder.createErrorAnnotation(textRange, "Undefined Step")).thenReturn(new Annotation(1, 1, new HighlightSeverity("dsf", 1), "", ""));
new StepAnnotator(helper).annotate(element, holder);
verify(holder, times(1)).createErrorAnnotation(textRange, "Undefined Step");
}
Aggregations