/* © SRSoftware 2025 */
import static java.text.MessageFormat.format;
import static org.junit.jupiter.api.Assertions.assertEquals;

import de.srsoftware.umbrella.core.api.Translator;
import java.util.Map;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;

public class TranslatorTest {

	private static final Translator translator = new Translator() {
		@Override
		public String translate(String language, String text, Map<String, String> fills) {
			return format("lang: {0}, text: {1}, fills: {2}",language,text, new JSONObject(fills).toString());
		}
	};

	@Test
	public void testTranslate(){
		var translated = translator.translate("none","dies {verb} ein {subject}|subject=test|verb=ist");
		assertEquals("lang: none, text: dies {verb} ein {subject}, fills: {\"verb\":\"ist\",\"subject\":\"test\"}",translated);
	}
}
