Exemple #1
0
        public void RoundTripTransmissionWithIdAttributeIsSuccessful()
        {
            using (var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(Transmission)))
            using (var outputStream = new MemoryStream())
            using (XmlWriter writer = new XmlWriterDecorator(new GedcomWriter(outputStream, Encoding.ASCII)))
            {
                var dom = new XmlDocument();
                dom.Load(new GedcomReader(inputStream));
                dom.Save(writer);

                outputStream.Seek(0, SeekOrigin.Begin);
                Assert.Equal(Transmission.ToCharArray(), new StreamReader(outputStream).ReadToEnd().ToCharArray());
            }
        }
Exemple #2
0
        public void RoundTripTransmissionWithIdAttributeIsSuccessful()
        {
            using (var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(Transmission)))
                using (var outputStream = new MemoryStream())
                    using (XmlWriter writer = new XmlWriterDecorator(new GedcomWriter(outputStream, Encoding.ASCII)))
                    {
                        var dom = new XmlDocument();
                        dom.Load(new GedcomReader(inputStream));
                        dom.Save(writer);

                        outputStream.Seek(0, SeekOrigin.Begin);
                        Assert.Equal(Transmission.ToCharArray(), new StreamReader(outputStream).ReadToEnd().ToCharArray());
                    }
        }
Exemple #3
0
        public void RoundTripIsSuccessful()
        {
            const string transmission = "0 Items\n" +
                                        "1 Item first item\n" +
                                        "2 SubItem @attr1@ subitem with attribute\n";

            using (var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(transmission)))
            using (var outputStream = new MemoryStream())
            using (XmlWriter writer = new XmlWriterDecorator(new GedcomWriter(outputStream, Encoding.ASCII)))
            {
                var dom = new XmlDocument();
                dom.Load(new GedcomReader(inputStream));
                dom.Save(writer);

                outputStream.Seek(0, SeekOrigin.Begin);
                Assert.Equal(transmission.ToCharArray(), new StreamReader(outputStream).ReadToEnd().ToCharArray());
            }
        }
Exemple #4
0
        public void RoundTripIsSuccessful()
        {
            const string transmission = "0 Items\n" +
                                        "1 Item first item\n" +
                                        "2 SubItem @attr1@ subitem with attribute\n";

            using (var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(transmission)))
                using (var outputStream = new MemoryStream())
                    using (XmlWriter writer = new XmlWriterDecorator(new GedcomWriter(outputStream, Encoding.ASCII)))
                    {
                        var dom = new XmlDocument();
                        dom.Load(new GedcomReader(inputStream));
                        dom.Save(writer);

                        outputStream.Seek(0, SeekOrigin.Begin);
                        Assert.Equal(transmission.ToCharArray(), new StreamReader(outputStream).ReadToEnd().ToCharArray());
                    }
        }