use of com.thoughtworks.gauge.helper.ModuleHelper in project Intellij-Plugin by getgauge.
the class ImplUsageProviderTest method TestIsImplicitUsageForNonGaugeElement.
@Test
public void TestIsImplicitUsageForNonGaugeElement() throws Exception {
ModuleHelper helper = mock(ModuleHelper.class);
PsiMethod method = mock(PsiMethod.class);
PsiModifierList list = mock(PsiModifierList.class);
when(list.getAnnotations()).thenReturn(new PsiAnnotation[] {});
when(method.getModifierList()).thenReturn(list);
when(helper.isGaugeModule(method)).thenReturn(true);
boolean isUsed = new ImplUsageProvider(null, helper).isImplicitUsage(method);
assertFalse(isUsed);
}
use of com.thoughtworks.gauge.helper.ModuleHelper in project Intellij-Plugin by getgauge.
the class SpecStepImplTest method testShouldGetReferenceInGaugeModule.
@Test
public void testShouldGetReferenceInGaugeModule() throws Exception {
ModuleHelper helper = mock(ModuleHelper.class);
ASTNode node = mock(ASTNode.class);
SpecStepImpl specStep = new SpecStepImpl(node, helper);
when(helper.isGaugeModule(specStep)).thenReturn(true);
PsiReference reference = specStep.getReference();
assertEquals(reference.getClass(), StepReference.class);
}
use of com.thoughtworks.gauge.helper.ModuleHelper in project Intellij-Plugin by getgauge.
the class SpecStepImplTest method testShouldNotGetReferenceInNonGaugeModule.
@Test
public void testShouldNotGetReferenceInNonGaugeModule() throws Exception {
ModuleHelper helper = mock(ModuleHelper.class);
ASTNode node = mock(ASTNode.class);
SpecStepImpl specStep = new SpecStepImpl(node, helper);
when(helper.isGaugeModule(specStep)).thenReturn(false);
PsiReference reference = specStep.getReference();
assertNull(reference);
}
use of com.thoughtworks.gauge.helper.ModuleHelper in project Intellij-Plugin by getgauge.
the class ImplUsageProviderTest method TestIsImplicitUsageWithNoModule.
@Test
public void TestIsImplicitUsageWithNoModule() throws Exception {
ModuleHelper helper = mock(ModuleHelper.class);
boolean isUsed = new ImplUsageProvider(null, helper).isImplicitUsage(mock(PsiElement.class));
assertFalse(isUsed);
}
use of com.thoughtworks.gauge.helper.ModuleHelper in project Intellij-Plugin by getgauge.
the class ConceptStepImplTest method testShouldNotGetReferenceInNonGaugeModule.
@Test
public void testShouldNotGetReferenceInNonGaugeModule() throws Exception {
ModuleHelper helper = mock(ModuleHelper.class);
ASTNode node = mock(ASTNode.class);
ConceptStepImpl conceptStep = new ConceptStepImpl(node, helper);
when(helper.isGaugeModule(conceptStep)).thenReturn(false);
PsiReference reference = conceptStep.getReference();
assertNull(reference);
}
Aggregations