示例#1
0
        public void CreateStylesheets_TestChrysalis_CreatesCorrectStylesheet()
        {
            var chrysalis = ChrysalisMockFactory.CreateChrysalis();
            var generator = new StylesheetGenerator();
            var document  = generator.CreateStylesheets(chrysalis).First();

            Assert.IsType <XsltElement>(document.Root);
        }
示例#2
0
        public void CreateStylesheets_TestChrysalis_TransformsInputCorrectly()
        {
            var chrysalis = ChrysalisMockFactory.CreateChrysalis();
            var generator = new StylesheetGenerator();
            var document  = generator.CreateStylesheets(chrysalis).First();

            //WriteToFile(stylesheet);
            using (var documentReader = document.CreateReader())
                using (var inputReader = XmlReader.Create("TestCsvInput.xml"))
                    using (var stream = new MemoryStream())
                        using (var outputWriter = XmlWriter.Create(stream))
                        {
                            var transform = new XslCompiledTransform();

                            transform.Load(documentReader);
                            transform.Transform(inputReader, outputWriter);
                        }
        }