package org.liquidengine.legui.marshal.json.gsonimpl.border;

import com.google.gson.JsonElement;
import org.junit.Test;
import org.liquidengine.legui.border.SimpleLineBorder;
import org.liquidengine.legui.color.ColorConstants;
import org.liquidengine.legui.marshal.json.JsonMarshalContext;
import org.liquidengine.legui.marshal.json.gsonimpl.GsonMarshallingTestBase;
import org.liquidengine.legui.marshal.json.gsonimpl.GsonMarshalContext;

/**
 * Test for SimpleLineBorder Gson Marshaller.
 */
public class GsonSimpleLineBorderMarshallerTest extends GsonMarshallingTestBase {
    private SimpleLineBorder               border     = new SimpleLineBorder(ColorConstants.red(), 1.2f);
    private GsonSimpleLineBorderMarshaller marshaller = new GsonSimpleLineBorderMarshaller();
    private String                         pathToJson = "org/liquidengine/legui/marshal/json/gsonimpl/border/SimpleLineBorder.json";

    /**
     * Used to test {@link GsonSimpleLineBorderMarshaller#marshal(Object, JsonMarshalContext)}.
     *
     * @throws Exception in case of any exception occurred.
     */
    @Test
    public void marshal() throws Exception {
        testMarshal(border, marshaller, pathToJson);
    }


    /**
     * Used to test {@link GsonSimpleLineBorderMarshaller#unmarshal(JsonElement, GsonMarshalContext)}.
     *
     * @throws Exception in case of any exception occurred.
     */
    @Test
    public void unmarshal() throws Exception {
        testUnmarshal(border, marshaller, pathToJson);
    }

}
@@ -91,16 +91,76 @@
 lement;%0A
+import com.google.gson.JsonObject;%0Aimport org.junit.Assert;%0A
 import o
@@ -1210,50 +1210,191 @@
     
-testMarshal(border, marshaller, pathToJson
+String expected = readJsonFromFile(pathToJson).toString();%0A        String actual   = marshaller.marshal(border, new GsonMarshalContext());%0A        Assert.assertEquals(expected, actual
 );%0A 
@@ -1655,52 +1655,223 @@
     
-testUnmarshal(border, marshaller, pathToJson
+JsonObject       jsonToUnmarshal = readJsonFromFile(pathToJson);%0A        SimpleLineBorder actual          = marshaller.unmarshal(jsonToUnmarshal, new GsonMarshalContext());%0A        Assert.assertEquals(border, actual
 );%0A 

update SimpleLineBorder marshaller test.