From: <bo...@us...> - 2009-05-20 15:55:32
|
Revision: 332 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=332&view=rev Author: bodewig Date: 2009-05-20 15:55:23 +0000 (Wed, 20 May 2009) Log Message: ----------- whitespace Modified Paths: -------------- trunk/xmlunit/src/tests/net-core/builder/InputTest.cs Modified: trunk/xmlunit/src/tests/net-core/builder/InputTest.cs =================================================================== --- trunk/xmlunit/src/tests/net-core/builder/InputTest.cs 2009-05-20 15:47:19 UTC (rev 331) +++ trunk/xmlunit/src/tests/net-core/builder/InputTest.cs 2009-05-20 15:55:23 UTC (rev 332) @@ -19,88 +19,88 @@ namespace net.sf.xmlunit.builder { -[TestFixture] -public class InputTest { + [TestFixture] + public class InputTest { - private const string TEST_FILE = "../../../src/tests/resources/test1.xml"; + private const string TEST_FILE = "../../../src/tests/resources/test1.xml"; - private static XmlDocument Parse(ISource s) { - XmlDocument d = new XmlDocument(); - d.Load(s.Reader); - return d; - } + private static XmlDocument Parse(ISource s) { + XmlDocument d = new XmlDocument(); + d.Load(s.Reader); + return d; + } - [Test] public void ShouldParseADocument() { - XmlDocument d = Parse(Input.FromFile(TEST_FILE).Build()); - AllIsWellFor(Input.FromDocument(d).Build()); - } + [Test] public void ShouldParseADocument() { + XmlDocument d = Parse(Input.FromFile(TEST_FILE).Build()); + AllIsWellFor(Input.FromDocument(d).Build()); + } - [Test] public void ShouldParseAnExistingFileByName() { - AllIsWellFor(Input.FromFile(TEST_FILE).Build()); - } + [Test] public void ShouldParseAnExistingFileByName() { + AllIsWellFor(Input.FromFile(TEST_FILE).Build()); + } - [Test] public void ShouldParseAnExistingFileFromStream() { - using (FileStream fs = new FileStream(TEST_FILE, FileMode.Open, - FileAccess.Read)) { - AllIsWellFor(Input.FromStream(fs).Build()); + [Test] public void ShouldParseAnExistingFileFromStream() { + using (FileStream fs = new FileStream(TEST_FILE, FileMode.Open, + FileAccess.Read)) { + AllIsWellFor(Input.FromStream(fs).Build()); + } } - } - [Test] public void ShouldParseAnExistingFileFromReader() { - using (StreamReader r = new StreamReader(TEST_FILE)) { - AllIsWellFor(Input.FromReader(r).Build()); + [Test] public void ShouldParseAnExistingFileFromReader() { + using (StreamReader r = new StreamReader(TEST_FILE)) { + AllIsWellFor(Input.FromReader(r).Build()); + } } - } - [Test] public void ShouldParseString() { - AllIsWellFor(Input.FromMemory(Encoding.UTF8.GetString(ReadTestFile())) - .Build()); - } + [Test] public void ShouldParseString() { + AllIsWellFor(Input.FromMemory(Encoding.UTF8.GetString(ReadTestFile())) + .Build()); + } - [Test] public void ShouldParseBytes() { - AllIsWellFor(Input.FromMemory(ReadTestFile()).Build()); - } + [Test] public void ShouldParseBytes() { + AllIsWellFor(Input.FromMemory(ReadTestFile()).Build()); + } - [Ignore("looks as if file-URIs didn't work, revisit")] - [Test] public void ShouldParseFileFromURIString() { - AllIsWellFor(Input.FromURI("file:" + TEST_FILE).Build()); - } + [Ignore("looks as if file-URIs didn't work, revisit")] + [Test] public void ShouldParseFileFromURIString() { + AllIsWellFor(Input.FromURI("file:" + TEST_FILE).Build()); + } - [Ignore("looks as if file-URIs didn't work, revisit")] - [Test] public void ShouldParseFileFromURI() { - AllIsWellFor(Input.FromURI(new Uri("file:" + TEST_FILE)).Build()); - } + [Ignore("looks as if file-URIs didn't work, revisit")] + [Test] public void ShouldParseFileFromURI() { + AllIsWellFor(Input.FromURI(new Uri("file:" + TEST_FILE)).Build()); + } - [Test] public void ShouldParseATransformation() { - ISource input = Input.FromMemory("<animal>furry</animal>").Build(); - ISource s = Input.ByTransforming(input) - .WithStylesheet(Input.FromFile("../../../src/tests/resources/animal.xsl") - .Build()) - .Build(); - Assert.That(s, Is.Not.Null); - XmlDocument d = Parse(s); - Assert.That(d, Is.Not.Null); - Assert.That(d.DocumentElement.Name, Is.EqualTo("furry")); - } + [Test] public void ShouldParseATransformation() { + ISource input = Input.FromMemory("<animal>furry</animal>").Build(); + ISource s = Input.ByTransforming(input) + .WithStylesheet(Input.FromFile("../../../src/tests/resources/animal.xsl") + .Build()) + .Build(); + Assert.That(s, Is.Not.Null); + XmlDocument d = Parse(s); + Assert.That(d, Is.Not.Null); + Assert.That(d.DocumentElement.Name, Is.EqualTo("furry")); + } - private static void AllIsWellFor(ISource s) { - Assert.That(s, Is.Not.Null); - XmlDocument d = Parse(s); - Assert.That(d, Is.Not.Null); - Assert.That(d.DocumentElement.Name, Is.EqualTo("animal")); - } + private static void AllIsWellFor(ISource s) { + Assert.That(s, Is.Not.Null); + XmlDocument d = Parse(s); + Assert.That(d, Is.Not.Null); + Assert.That(d.DocumentElement.Name, Is.EqualTo("animal")); + } - private static byte[] ReadTestFile() { - using (FileStream fs = new FileStream(TEST_FILE, FileMode.Open, - FileAccess.Read)) - using (MemoryStream ms = new MemoryStream()) { - byte[] buffer = new byte[1024]; - int read = -1; - while ((read = fs.Read(buffer, 0, buffer.Length)) > 0) { - ms.Write(buffer, 0, read); + private static byte[] ReadTestFile() { + using (FileStream fs = new FileStream(TEST_FILE, FileMode.Open, + FileAccess.Read)) + using (MemoryStream ms = new MemoryStream()) { + byte[] buffer = new byte[1024]; + int read = -1; + while ((read = fs.Read(buffer, 0, buffer.Length)) > 0) { + ms.Write(buffer, 0, read); + } + return ms.ToArray(); + } } - return ms.ToArray(); - } } -} } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |