@@ -0,0 +1,1738 @@
+package fi.evident.apina.output.ts;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0A%0Aimport static java.util.Arrays.asList;%0Aimport static java.util.Collections.emptyMap;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class CodeWriterTest %7B%0A%0A    private final CodeWriter writer = new CodeWriter();%0A%0A    @Test%0A    public void indents() %7B%0A        writer.writeLine(%22foo %22);%0A        writer.writeBlock(() -%3E %7B%0A            writer.writeLine(%22bar%22);%0A            writer.writeLine(%22baz%22);%0A        %7D);%0A        writer.writeLine();%0A%0A        assertThat(writer.getOutput(), is(%22foo %5Cn%7B%5Cn    bar%5Cn    baz%5Cn%7D%5Cn%22));%0A    %7D%0A%0A    @Test%0A    public void stringValues() %7B%0A        writer.writeValue(%22foo 'bar' baz%5Cnquux%22);%0A%0A        assertThat(writer.getOutput(), is(%22'foo %5C%5C'bar%5C%5C' baz%5C%5Cnquux'%22));%0A    %7D%0A%0A    @Test%0A    public void numberValues() %7B%0A        writer.writeValue(42);%0A%0A        assertThat(writer.getOutput(), is(%2242%22));%0A    %7D%0A%0A    @Test%0A    public void booleanValues() %7B%0A        writer.writeValue(false);%0A%0A        assertThat(writer.getOutput(), is(%22false%22));%0A    %7D%0A%0A    @Test%0A    public void mapValues() %7B%0A        Map%3CString,Integer%3E map = new LinkedHashMap%3C%3E();%0A        map.put(%22foo%22, 1);%0A        map.put(%22bar%22, 2);%0A        map.put(%22baz%22, 3);%0A        writer.writeValue(map);%0A%0A        assertThat(writer.getOutput(), is(%22%7B%5Cn    'foo': 1,%5Cn    'bar': 2,%5Cn    'baz': 3%5Cn%7D%22));%0A    %7D%0A%0A    @Test%0A    public void emptyMapValues() %7B%0A        writer.writeValue(emptyMap());%0A%0A        assertThat(writer.getOutput(), is(%22%7B%7D%22));%0A    %7D%0A%0A    @Test%0A    public void collectionValues() %7B%0A        writer.writeValue(asList(1, 2, 3));%0A%0A        assertThat(writer.getOutput(), is(%22%5B1, 2, 3%5D%22));%0A    %7D%0A%7D%0A

Add tests for CodeWriter