public void GetNumberedAttributes_should_return_attributes_ordered_numerically() { // Arrange string xml = TestHelpers.ReadEmbeddedFile("ordered-attributes.xml", XmlExamplesFolder); XDocument document = XDocument.Parse(xml); var firstTestCase = document.Root.Elements().First(x => x.Name.LocalName == "case"); var testCaseReader = new LegacyTestCaseReader(); // Act List<ParseResponseItem> descriptions = testCaseReader.GetParseResponseItems(firstTestCase, "parseresponse"); // Assert Assert.That(descriptions[0].Description, Is.EqualTo("parseresponse0")); Assert.That(descriptions[0].Regex, Is.EqualTo("parse 0")); Assert.That(descriptions[1].Description, Is.EqualTo("parseresponse1")); Assert.That(descriptions[1].Regex, Is.EqualTo("parse 1")); Assert.That(descriptions[2].Description, Is.EqualTo("parseresponse2")); Assert.That(descriptions[2].Regex, Is.EqualTo("parse 2")); Assert.That(descriptions[3].Description, Is.EqualTo("parseresponse12")); Assert.That(descriptions[3].Regex, Is.EqualTo("parse 12")); }
public void should_do_something() { // Arrange var stringBuilder = new StringBuilder(); var httpLogWriter = new HttpLogWriter(new StringWriter(stringBuilder)); var httpClient = new HttpClient(httpLogWriter, new RestClient()); var config = new Config(); string xml = TestHelpers.ReadEmbeddedFile("wikipedia-simple.xml", XmlExamplesFolder); var stringReader = new StringReader(xml); var reader = new LegacyTestCaseReader(); var caseCollection = reader.Read(stringReader); var runner = new TestSessionRunner(config, httpClient, new ConsoleResultWriter()); // Act runner.Run(caseCollection); // Assert Console.WriteLine(stringBuilder); }