package info.richardjones.crossword.app.loader;

import com.google.common.base.CharMatcher;
import com.google.common.base.Splitter;
import com.google.gson.Gson;
import info.richardjones.crossword.app.vo.Cell;

import java.util.List;

import static com.google.common.collect.Lists.newArrayList;

public class TestCrosswordLoader {

    private CrosswordLoader crosswordLoader;

    public TestCrosswordLoader() {
        crosswordLoader = new CrosswordLoader(getTestString());
    }

    /*
    * [number:1;letter:C;down-clue:AB;across-clue:CD][letter:A][letter:T][]|
    * [letter:O}][][][number:2;letter:B;down-clue:TO...]|
    * [number:3;letter:T; across-clue:big bush][letter:R][letter:E][letter:E]
    */


    public List<Cell> getCells() {
        return crosswordLoader.load();
    }

    public String getTestString() {
        return
                "{number:1,letter:C,downClue:Bed}-{letter:A}-{letter:T}-{blank}|" +
                "{letter:O}-{blank}-{blank}-{number:2,letter:B,downClue:To...}|" +
                "{number:3,letter:T,acrossClue:big+bush}-{letter:R}-{letter:E}-{letter:E}";
    }

    public Integer getHeight(){
        return crosswordLoader.getHeight();
    }

    public Integer getWidth(){
        return crosswordLoader.getWidth();
    }
}

@@ -771,20 +771,24 @@
 dLoader.
-load
+getCells
 ();%0A    
@@ -841,16 +841,43 @@
  return%0A
+                /* 4 * 3*/%0A
         
@@ -1031,24 +1031,24 @@
 :To...%7D%7C%22 +%0A
-
             
@@ -1126,16 +1126,448 @@
 ter:E%7D%22;
+%0A%0A//        /* 2 * 3*/%0A//        %22%7Bnumber:1,letter:C,downClue:Bed%7D-%7Bletter:A%7D%7C%22 +%0A//                %22%7Bletter:O%7D-%7Bblank%7D%7C%22 +%0A//                %22%7Bnumber:3,letter:T,acrossClue:big+bush%7D-%7Bletter:R%7D%22;%0A%0A//        /* 5 * 2*/%0A//        %22%7Bnumber:1,letter:C,downClue:Bed%7D-%7Bletter:A%7D-%7Bletter:T%7D-%7Bblank%7D-%7Bnumber:3,letter:B,downClue:Digging+Stick%7D%7C%22 +%0A//                %22%7Bletter:O%7D-%7Bblank%7D-%7Bblank%7D-%7Bnumber:2,letter:B,downClue:To...%7D-%7Bletter:A%7D%22;
 %0A    %7D%0A%0A

rename of method plus more test strings