package com.alanrusnak.api2048.engine;

import com.alanrusnak.api2048.engine.model.Tile;
import org.junit.Assert;
import org.junit.Test;

public class MoveExecutorTest {

    MoveExecutor moveExecutor = new MoveExecutor();

    @Test
    public void testSlideTile0Spaces(){
        Tile[] row = row(0,0,0,2);
        moveExecutor.slideRight(row);
        Assert.assertEquals(2, row[3].getValue());
    }

    @Test
    public void testSlideTile1Spaces(){
        Tile[] row = row(0,0,2,0);
        moveExecutor.slideRight(row);
        Assert.assertEquals(2, row[3].getValue());
    }

    @Test
    public void testSlideTile2Spaces(){
        Tile[] row = row(0,2,0,0);
        moveExecutor.slideRight(row);
        Assert.assertEquals(2, row[3].getValue());
    }

    @Test
    public void testSlideTile3Spaces(){
        Tile[] row = row(2,0,0,0);
        moveExecutor.slideRight(row);
        Assert.assertEquals(2, row[3].getValue());
    }

    private Tile[] row(int t1, int t2, int t3, int t4){
        return new Tile[]{new Tile(t1), new Tile(t2), new Tile(t3), new Tile(t4)};
    }
}

@@ -937,24 +937,390 @@
 ());%0A    %7D%0A%0A
+    @Test%0A    public void testSlideTileWithSpaceTaken()%7B%0A        Tile%5B%5D row = row(2,0,0,4);%0A        moveExecutor.slideRight(row);%0A        Assert.assertEquals(2, row%5B2%5D.getValue());%0A    %7D%0A%0A    @Test%0A    public void testMergeTwoTiles()%7B%0A        Tile%5B%5D row = row(2,0,0,2);%0A        moveExecutor.slideRight(row);%0A        Assert.assertEquals(4, row%5B3%5D.getValue());%0A    %7D%0A%0A
     private 

Add a new non passing test case for merging