Exemplo n.º 1
0
        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);
        }
Exemplo n.º 3
0
        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", "&#160;");
            }

            return String.Empty;
        }
Exemplo n.º 5
0
        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", "&#160;"));
            }

            return(String.Empty);
        }
Exemplo n.º 6
0
        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());
        }