private void AssertResult(string expected, params Action <DomWriter>[] actions)
        {
            var       sw = new StringWriter();
            DomWriter w  = DomWriter.Create(sw, DomWriterSettings.Empty);

            foreach (var a in actions)
            {
                a(w);
            }
            Assert.Equal(expected, sw.ToString());
        }
Ejemplo n.º 2
0
 public void Create_should_create_writer_for_default_settings_type()
 {
     Assert.IsInstanceOf <DefaultDomWriter>(DomWriter.Create(TextWriter.Null, DomWriterSettings.Empty));
 }
 public void DomWriter_Create_should_create_writer_for_custom_file_name()
 {
     Assert.IsInstanceOf <CustomWriter>(
         DomWriter.Create(new FSStreamContext(new Uri("hello.custom", UriKind.Relative)), DomWriterSettings.Empty)
         );
 }
Ejemplo n.º 4
0
 public void Create_should_create_writer_for_XML_by_default()
 {
     Assert.IsInstanceOf <XmlDomWriter>(DomWriter.Create(TextWriter.Null, null));
 }