/**
 * 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 SsmlSub}
 */
public class SsmlSubTest {
    @Test
    public void testElementWithParams() {
        SsmlSub elem = new SsmlSub.Builder("words").alias("alias").build();

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

    @Test
    public void testXmlAttributesDeserialization() {
        final SsmlSub elem = new SsmlSub.Builder("words").alias("alias").build();

        Assert.assertEquals(
            SsmlSub.Builder.fromXml("<sub alias=\"alias\">words</sub>").build().toXml(),
            elem.toXml()
        );
    }
}