Add JSON serialization tests for NominalFacetChoice

This commit is contained in:
Antonin Delpeuch 2018-08-21 17:44:45 +02:00
parent 953a7380fe
commit 326fda7999

View File

@ -0,0 +1,23 @@
package com.google.refine.tests.browsing.facets;
import org.testng.annotations.Test;
import com.google.refine.browsing.DecoratedValue;
import com.google.refine.browsing.facets.NominalFacetChoice;
import com.google.refine.tests.util.TestUtils;
public class NominalFacetChoiceTests {
@Test
public void serializeNominalFacetChoice() {
DecoratedValue value = new DecoratedValue("some string", "some string");
NominalFacetChoice choice = new NominalFacetChoice(value);
choice.count = 3;
choice.selected = true;
TestUtils.isSerializedTo(choice, "{"
+ "\"v\":"
+ " {\"v\":\"some string\","
+ " \"l\":\"some string\"},"
+ "\"c\":3,"
+ "\"s\":true}");
}
}