public void IntegrationTest() { string ReportFilePath = @"C:\Temp\TpReport.xml"; if (File.Exists(ReportFilePath)) { File.Delete(ReportFilePath); } TargetProcessReportTask testSubject = new TargetProcessReportTask(); testSubject.ConnectionInformation.UserName = "******"; testSubject.ConnectionInformation.Password = "******"; testSubject.ConnectionInformation.RootServiceUrl = "http://agilex.tpondemand.com"; testSubject.TaskIds = new StringList("999999"); testSubject.StoryIds = new StringList(); testSubject.BugIds = new StringList(); testSubject.ReportFilePath = ReportFilePath; testSubject.GenerateReport(); FileAssert.Exists(ReportFilePath); string xml = File.ReadAllText(ReportFilePath); XmlAssert.XPathEvaluatesTo(@"/TargetProcess/Entity/@Name", xml, "name"); XmlAssert.XPathEvaluatesTo(@"/TargetProcess/Entity/@Type", xml, "type"); XmlAssert.XPathEvaluatesTo(@"/TargetProcess/Entity/@HyperLink", xml, "link"); XmlAssert.XPathEvaluatesTo(@"/TargetProcess/Entity", xml, "description"); }
[Test] public void AssertXPathEvaluatesToWorksConstantExpression() { XmlAssert.XPathEvaluatesTo("true()", MY_SOLAR_SYSTEM, "True"); XmlAssert.XPathEvaluatesTo("false()", MY_SOLAR_SYSTEM, "False"); }
[Test] public void AssertXPathEvaluatesToWorksForNonMatchingExpression() { XmlAssert.XPathEvaluatesTo("//planet[@position='4']/@supportsLife", MY_SOLAR_SYSTEM, ""); }