public void SutCanRoundTripAttributedClassInstance(
            DataContractContentSerializer sut,
            DataContractTestEventX dctex)
        {
            using (var ms = new MemoryStream())
                using (var w = XmlWriter.Create(ms))
                {
                    sut.Serialize(w, dctex);
                    w.Flush();
                    ms.Position = 0;
                    using (var r = XmlReader.Create(ms))
                    {
                        var content = sut.Deserialize(r);

                        var actual = Assert.IsAssignableFrom <DataContractTestEventX>(content.Item);
                        Assert.Equal(dctex.Number, actual.Number);
                        Assert.Equal(dctex.Text, actual.Text);
                    }
                }
        }
        public void SerializeCorrectlySerializesAttributedClassInstance(
            DataContractContentSerializer sut,
            DataContractTestEventX dctex)
        {
            var sb = new StringBuilder();

            using (var w = XmlWriter.Create(sb))
            {
                sut.Serialize(w, dctex);
                w.Flush();
                var actual = sb.ToString();

                var expected = XDocument.Parse(
                    "<test-event-x xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://grean.rocks/dc\">" +
                    "  <number>" + dctex.Number + "</number>" +
                    "  <text>" + dctex.Text + "</text>" +
                    "</test-event-x>");
                Assert.Equal(expected, XDocument.Parse(actual), new XNodeEqualityComparer());
            }
        }
        public void SutCanRoundTripAttributedClassInstance(
            DataContractContentSerializer sut,
            DataContractTestEventX dctex)
        {
            using (var ms = new MemoryStream())
            using (var w = XmlWriter.Create(ms))
            {
                sut.Serialize(w, dctex);
                w.Flush();
                ms.Position = 0;
                using (var r = XmlReader.Create(ms))
                {
                    var content = sut.Deserialize(r);

                    var actual = Assert.IsAssignableFrom<DataContractTestEventX>(content.Item);
                    Assert.Equal(dctex.Number, actual.Number);
                    Assert.Equal(dctex.Text, actual.Text);
                }
            }
        }
        public void SerializeCorrectlySerializesAttributedClassInstance(
            DataContractContentSerializer sut,
            DataContractTestEventX dctex)
        {
            var sb = new StringBuilder();
            using (var w = XmlWriter.Create(sb))
            {
                sut.Serialize(w, dctex);
                w.Flush();
                var actual = sb.ToString();

                var expected = XDocument.Parse(
                    "<test-event-x xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://grean.rocks/dc\">" +
                    "  <number>" + dctex.Number + "</number>" +
                    "  <text>" + dctex.Text + "</text>" +
                    "</test-event-x>");
                Assert.Equal(expected, XDocument.Parse(actual), new XNodeEqualityComparer());
            }
        }