/**
 * 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 Task}
 */
public class TaskTest {
    @Test
    public void testElementWithParams() {
        Task elem = new Task.Builder("body").priority(1).timeout(1).build();

        Assert.assertEquals(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "<Task priority=\"1\" timeout=\"1\">body</Task>",
            elem.toXml()
        );
    }

    @Test
    public void testXmlAttributesDeserialization() {
        final Task elem = new Task.Builder("body").priority(1).timeout(1).build();

        Assert.assertEquals(
            Task.Builder.fromXml("<Task priority=\"1\" timeout=\"1\">body</Task>").build().toXml(),
            elem.toXml()
        );
    }
}