public void ToXElement()
        {
            SerialPortSettings serialPortSettings = new SerialPortSettings(BaudRate.BR_57600,
                Parity.Odd, StopBits.One, 0xAA, 0xA5);

            XElement xElement = serialPortSettings.ToXElement("namespace");

            string xElementSerialPortSettings =
                "<serialPortSettings xmlns=\"namespace\">" + "\r\n  " +
                "<baudrate>57600</baudrate>" + "\r\n  " +
                "<parity>1</parity>" + "\r\n  " +
                "<stopbit>1</stopbit>" + "\r\n  " +
                "<headerTx>0xAA</headerTx>" + "\r\n  " +
                "<headerRx>0xA5</headerRx>" + "\r\n" +
                "</serialPortSettings>";

            Assert.AreEqual(xElementSerialPortSettings, xElement.ToString());
        }
        public void ToXElement()
        {
            SerialPortSettings serialPortSettings = new SerialPortSettings(BaudRate.BR_57600,
                                                                           Parity.Odd, StopBits.One, 0xAA, 0xA5);

            XElement xElement = serialPortSettings.ToXElement("namespace");

            string xElementSerialPortSettings =
                "<serialPortSettings xmlns=\"namespace\">" + "\r\n  " +
                "<baudrate>57600</baudrate>" + "\r\n  " +
                "<parity>1</parity>" + "\r\n  " +
                "<stopbit>1</stopbit>" + "\r\n  " +
                "<headerTx>0xAA</headerTx>" + "\r\n  " +
                "<headerRx>0xA5</headerRx>" + "\r\n" +
                "</serialPortSettings>";

            Assert.AreEqual(xElementSerialPortSettings, xElement.ToString());
        }