public string processFragment(string fragment, string csv) { usernames = csvToCollection(csv); XDocument document = new TestRig() .WithFixture(this) .ProcessFragment(fragment) .GetXDocument(); var result = String.Empty; var table = document.Descendants("table").ToList()[0]; var rows = table.Elements("tr"); for (int index = 1; index < rows.Count(); index++) { var row = rows.ToArray()[index]; if (!String.IsNullOrEmpty(result)) { result += ", "; } result += categorize(row); } return result; }
public string processFragment(string fragment, string csv) { usernames = csvToCollection(csv); XDocument document = new TestRig() .WithFixture(this) .ProcessFragment(fragment) .GetXDocument(); var result = String.Empty; var table = document.Descendants("table").ToList()[0]; var rows = table.Elements("tr"); for (int index = 1; index < rows.Count(); index++) { var row = rows.ToArray()[index]; if (!String.IsNullOrEmpty(result)) { result += ", "; } result += categorize(row); } return(result); }
public string markAsException(string fragment, string expression, string errorMessage) { var exception = new StackTraceSettingException(errorMessage); exception.StackTraceElements.AddRange(stackTraceElements); var document = new TestRig() .ProcessFragment(fragment) .GetXDocument(); var element = new Element(document.Descendants("p").ToArray()[0]); new ExceptionRenderer().ExceptionCaught(new ExceptionCaughtEvent(exception, element, expression)); return(element.ToXml()); }
public string getOutputFragment(string inputFragment) { var document = new TestRig() .WithFixture(this) .ProcessFragment(inputFragment) .GetXDocument(); var tables = document.Descendants("table"); foreach (var table in tables) { // stops loop after first entry, simulating the java code. return table.ToString().Replace("\u00A0", " "); } return String.Empty; }
public string getOutputFragment(string inputFragment) { var document = new TestRig() .WithFixture(this) .ProcessFragment(inputFragment) .GetXDocument(); var tables = document.Descendants("table"); foreach (var table in tables) { // stops loop after first entry, simulating the java code. return(table.ToString().Replace("\u00A0", " ")); } return(String.Empty); }
public string markAsException(string fragment, string expression, string errorMessage) { var exception = new StackTraceSettingException(errorMessage); exception.StackTraceElements.AddRange(stackTraceElements); var document = new TestRig() .ProcessFragment(fragment) .GetXDocument(); var element = document.Descendants("p").ToArray()[0]; var eventArgs = new ExceptionCaughtEventArgs { Exception = exception, Expression = expression, Element = new Element(element) }; new ExceptionRenderer().ExceptionCaughtEventHandler(this, eventArgs); //return element.ToString(SaveOptions.DisableFormatting); return(element.ToString()); }