Ad
  • Custom User Avatar

    Thanks LeftofZen, I added your change. I did attempt to swap the assertEquals method's arguments though, as the expected:<[throw towel]> but was:<[42 -9]> was annoying the hell out of me.

    Is it just me or is the Example Test Cases totally untestable in in the Kata editor and even omnitted from the revisions page?
    No wonder so many Katas has broken Example Test Cases.

    PS: Is the Java Test Cases ok? It uses somewhat the same as what the Example Test Cases had.

  • Custom User Avatar

    You need to import junit.Assert if you want to use assert in Java. You also need to fix up the actual assert line to use equals since we are doing a string comparison. Change the default test case to the following:

    import org.junit.Test;
    
    import static junit.framework.TestCase.fail;
    import static org.junit.Assert.*;
    
    public class Tests {
      @Test
      public void Test1() {
        assertEquals(Kata.HighAndLow("8 3 -5 42 -1 0 0 -9 4 7 4 -4"), "42 -9");
      }
    }
    
  • Custom User Avatar

    I don't know Java, so if you can tell me what is wrong I will fix it.