/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */

package com.twilio.twiml.voice;

import org.junit.Assert;
import org.junit.Test;

/**
 * Test class for {@link SsmlPhoneme}
 */
public class SsmlPhonemeTest {
    @Test
    public void testElementWithParams() {
        SsmlPhoneme elem = new SsmlPhoneme.Builder("words").alphabet(SsmlPhoneme.Alphabet.IPA).ph("ph").build();

        Assert.assertEquals(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "<phoneme alphabet=\"ipa\" ph=\"ph\">words</phoneme>",
            elem.toXml()
        );
    }

    @Test
    public void testXmlAttributesDeserialization() {
        final SsmlPhoneme elem = new SsmlPhoneme.Builder("words").alphabet(SsmlPhoneme.Alphabet.IPA).ph("ph").build();

        Assert.assertEquals(
            SsmlPhoneme.Builder.fromXml("<phoneme alphabet=\"ipa\" ph=\"ph\">words</phoneme>").build().toXml(),
            elem.toXml()
        );
    }
}