Skip to content

Commit

Permalink
Make test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Sep 15, 2016
1 parent 1b80d26 commit 28fd1e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/fitnesse/slim/SlimServiceTest.java
Expand Up @@ -4,6 +4,7 @@

import java.io.IOException;

import fitnesse.slim.fixtureInteraction.InteractionDemo;
import org.junit.Test;

import static org.junit.Assert.*;
Expand Down Expand Up @@ -39,14 +40,16 @@ protected String expectedStopTestExceptionMessage() {

@Test
public void nullInteractionService_returnsDefaultClass() {
String defaultInteractionName = JavaSlimFactory.createInteraction(null).getClass().getName();
SlimService.Options options = SlimService.parseCommandLine(new String[]{"8099"});
assertEquals("fitnesse.slim.fixtureInteraction.DefaultInteraction", options.interaction.getClass().getName());
assertEquals(defaultInteractionName, options.interaction.getClass().getName());
}

@Test
public void definedInteractionService_returnsCorrectClass() {
SlimService.Options options = SlimService.parseCommandLine(new String[]{"-i", "fitnesse.slim.fixtureInteraction.InteractionDemo", "8099"});
assertEquals("fitnesse.slim.fixtureInteraction.InteractionDemo", options.interaction.getClass().getName());
String interactionClassName = InteractionDemo.class.getName();
SlimService.Options options = SlimService.parseCommandLine(new String[]{"-i", interactionClassName, "8099"});
assertEquals(interactionClassName, options.interaction.getClass().getName());
}

@Test
Expand Down

0 comments on commit 28fd1e3

Please sign in to comment.