package fitnesse.slim.instructions;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;

public class MakeInstructionTest {
  private static final String ID = "id_1";
  private static final String RESULT = "OK";

  private InstructionExecutor executor;

  @Before
  public void setUp() throws Exception {
    executor = mock(InstructionExecutor.class);
  }

  @Test
  public void shouldDelegateCallToExecutor() throws Exception {
    MakeInstruction instruction = new MakeInstruction(ID, "instance", "class", new Object[]{"arg1", "arg2"});

    instruction.execute(executor);

    verify(executor, times(1)).create("instance", "class", "arg1", "arg2");
  }

  @Test
  @SuppressWarnings("unchecked")
  public void shouldFormatReturnValues() {
    MakeInstruction instruction = new MakeInstruction(ID, "instance", "class", new Object[]{"arg1", "arg2"});

    InstructionResult result = instruction.execute(executor);

    assertEquals(ID, result.getId());
    assertTrue(result.hasResult());
    assertFalse(result.hasError());
    assertEquals("OK", result.getResult());
  }
}

@@ -830,41 +830,8 @@
 est%0A
-  @SuppressWarnings(%22unchecked%22)%0A
   pu

Drop unnecessary suppressWarnings