本文整理汇总了C#中Parse.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Parse.ToString方法的具体用法?C# Parse.ToString怎么用?C# Parse.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse
的用法示例。
在下文中一共展示了Parse.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarksDifferentStringCellAsWrong
public void MarksDifferentStringCellAsWrong()
{
var cell = new Parse("td", "something else", null, null);
var fixture = new Fixture {Processor = new Service.Service()};
fixture.CellOperation.Check(new TypedValue("something"), cell);
Assert.AreEqual("\n<td class=\"fail\">something else <span class=\"fit_label\">expected</span><hr />something <span class=\"fit_label\">actual</span></td>", cell.ToString());
}
示例2: MarksSameStringCellAsRight
public void MarksSameStringCellAsRight()
{
var cell = new Parse("td", "something", null, null);
var fixture = new Fixture {Processor = new Service.Service()};
fixture.CellOperation.Check(new TypedValue("something"), cell);
Assert.AreEqual("\n<td class=\"pass\">something</td>", cell.ToString());
}
示例3: MarksSameArrayCellAsRight
public void MarksSameArrayCellAsRight()
{
var cell = new Parse("td", "something,more", null, null);
var fixture = new Fixture {Processor = new Service.Service()};
fixture.Processor.Check(new TypedValue(new [] {"something", "more"}), cell);
Assert.AreEqual("\n<td class=\"pass\">something,more</td>", cell.ToString());
}
示例4: Differences
private static string Differences(Parse theActual, Parse theExpected)
{
if (theActual == null) {
return (theExpected != null ? FormatNodeDifference(theActual, theExpected) : string.Empty);
}
if (theExpected == null) {
return FormatNodeDifference(theActual, theExpected);
}
var actualString = theActual.ToString().Replace("\n", string.Empty).Replace("\r", string.Empty);
var expectedString = theExpected.ToString().Replace("\n", string.Empty).Replace("\r", string.Empty);
if (actualString == expectedString) return string.Empty;
var expected = new Expected(theExpected);
if (theActual.Tag != expected.Node.Tag) {
return FormatNodeDifference(theActual, expected.Node);
}
string result = BodyDifferences(theActual.Body, expected.Node.Body);
if (result.Length > 0) {
return string.Format("in {0} body, {1}", theActual.Tag, result);
}
result = Differences(theActual.Parts, theExpected.Parts);
if (result.Length > 0) {
return string.Format("in {0}, {1}", theActual.Tag, result);
}
return Differences(theActual.More, theExpected.More);
}
示例5: TestStart
public void TestStart()
{
table = BuildTable("ActionFixture");
var fixture = new ActionFixture { Processor = new Service.Service(memory) };
fixture.DoTable(table);
Assert.AreEqual(0, fixture.TestStatus.Counts.GetCount(TestStatus.Exception), table.ToString());
Assert.IsNotNull(fixture.GetTargetObject());
}
示例6: TestCheckOnTimedActionFixture
public void TestCheckOnTimedActionFixture()
{
table = BuildTable("TimedActionFixture");
var fixture = new ActionFixture{ Processor = new Service.Service(configuration) };
fixture.DoTable(table);
Assert.AreEqual(0, fixture.TestStatus.Counts.GetCount(TestStatus.Exception), table.ToString());
var countFixture = (CountFixture)fixture.GetTargetObject();
int actualCount = countFixture.Counter;
Assert.AreEqual(6, actualCount);
Assert.AreEqual(4, countFixture.TestStatus.Counts.GetCount(TestStatus.Right));
}
示例7: TestCheck
public void TestCheck()
{
table = new Parse(BuildTable("ActionFixture"));
var fixture = new ActionFixture{ Processor = new Service.Service(configuration) };
fixture.DoTable(table);
Assert.AreEqual(0, fixture.TestStatus.Counts.GetCount(CellAttributes.ExceptionStatus), table.ToString());
var countFixture = (CountFixture)fixture.GetTargetObject();
int actualCount = countFixture.Counter;
Assert.AreEqual(6, actualCount);
Assert.AreEqual(4, fixture.TestStatus.Counts.GetCount(CellAttributes.RightStatus));
}
示例8: TestSurplus
public void TestSurplus()
{
TestUtils.InitAssembliesAndNamespaces();
var builder = new StringBuilder();
builder.Append("<table>");
builder.Append("<tr><td>BusinessObjectRowFixture</td></tr>");
builder.Append("<tr><td>GetFirstString</td></tr>");
builder.Append("<tr><td>number1</td></tr>");
builder.Append("</table>");
var parse = new Parse(builder.ToString());
BusinessObjectRowFixture.objects = new object[]
{
new BusinessObject(new[] {"number1"}),
new BusinessObject(new[] {"number2"}),
new BusinessObject(new[] {"number3"})
};
RunTest(parse);
Assert.IsTrue(parse.ToString().IndexOf("number1") > 0);
Assert.IsTrue(parse.ToString().IndexOf("number2") > 0);
Assert.IsTrue(parse.ToString().IndexOf("number3") > 0);
TestUtils.CheckCounts(resultCounts, 1, 2, 0, 0);
}
示例9: TestStartsWithHandlerInSecondColumn
public void TestStartsWithHandlerInSecondColumn()
{
//???ObjectFactory.AddNamespace("fitnesse.Handlers");
new Service.Service(configuration).AddOperator(typeof(CompareStartsWith).FullName);
var builder = new StringBuilder();
builder.Append("<table>");
builder.Append("<tr><td>people row fixture</td></tr>");
builder.Append("<tr><td>first name</td><td>last name</td></tr>");
builder.Append("<tr><td>Nigel</td><td>Tuf..</td></tr>");
builder.Append("</table>");
PeopleLoaderFixture.people.Clear();
PeopleLoaderFixture.people.Add(new Person("Nigel", "Tufnel"));
var tables = new Parse(builder.ToString());
RunTest(tables);
Assert.IsTrue(tables.ToString().IndexOf("Tuf..") > -1);
Assert.IsFalse(tables.ToString().IndexOf("Tufnel") > -1);
TestUtils.CheckCounts(resultCounts, 2, 0, 0, 0);
}
示例10: TestCorrectFormatForMissing
public void TestCorrectFormatForMissing()
{
PeopleLoaderFixture.people.Clear();
const string loaderFixtureHtml = "<table>" +
"<tr><td colspan=\"3\">people loader fixture</td></tr>" +
"<tr><td>id</td><td>first name</td><td>last name</td></tr>" +
"<tr><td>1</td><td>null</td><td>Jones</td></tr>" +
"<tr><td>2</td><td>Phil</td><td>blank</td></tr>" +
"</table>";
const string inspectorFixtureHtml = "<table>" +
"<tr><td colspan=\"3\">people row fixture</td></tr>" +
"<tr><td>id</td><td>first name</td><td>last name</td></tr>" +
"<tr><td>7</td><td>nullest</td><td>Jonesey</td></tr>" +
"<tr><td>2</td><td>Phil</td><td>blank</td></tr>" +
"</table>";
const string processedInspectorFixtureHtml = "<table>" +
"<tr><td colspan=\"3\">people row fixture</td></tr>" +
"<tr><td>id</td><td>first name</td><td>last name</td></tr>" +
"<tr><td class=\"fail\">7 <span class=\"fit_label\">missing</span></td><td>nullest</td><td>Jonesey</td></tr>" +
"<tr><td class=\"pass\">2</td><td class=\"pass\">Phil</td><td class=\"pass\">blank</td></tr>" +
"\n<tr>\n<td class=\"fail\"><span class=\"fit_grey\">1</span> <span class=\"fit_label\">surplus</span></td>\n<td><span class=\"fit_grey\">null</span></td>\n<td><span class=\"fit_grey\">Jones</span></td></tr>" +
"</table>";
var tables = new Parse(loaderFixtureHtml + inspectorFixtureHtml);
RunTest(tables);
Assert.AreEqual(loaderFixtureHtml + processedInspectorFixtureHtml, tables.ToString());
}
示例11: TestArrayOfStrings
public void TestArrayOfStrings()
{
ArrayOfStringsRowFixture.items.Clear();
const string setUpTableHtml = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsFixture</td></tr>" +
"<tr><td>field</td><td>save!</td></tr>" +
"<tr><td>a,b,c</td><td></td></tr>" +
"</table>";
const string processedSetUpTableHtml = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsFixture</td></tr>" +
"<tr><td>field</td><td>save!</td></tr>" +
"<tr><td>a,b,c</td><td><span class=\"fit_grey\"> null</span></td></tr>" +
"</table>";
const string tableHtml = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsRowFixture</td></tr>" +
"<tr><td>field</td></tr>" +
"<tr><td>a,b,c</td></tr>" +
"</table>";
const string expected = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsRowFixture</td></tr>" +
"<tr><td>field</td></tr>" +
"<tr><td class=\"pass\">a,b,c</td></tr>" +
"</table>";
var tables = new Parse(setUpTableHtml + tableHtml);
RunTest(tables);
Assert.AreEqual(processedSetUpTableHtml + expected, tables.ToString());
}
示例12: TestStart
public void TestStart()
{
table = new Parse(BuildTable("ActionFixture"));
var fixture = new ActionFixture { Processor = new Service.Service(configuration) };
fixture.DoTable(table);
Assert.AreEqual(0, fixture.TestStatus.Counts.GetCount(CellAttributes.ExceptionStatus), table.ToString());
Assert.IsNotNull(fixture.GetTargetObject());
}
示例13: TestArrayOfStrings
public void TestArrayOfStrings()
{
ArrayOfStringsRowFixture.items.Clear();
string setUpTableHtml =
//"<table>" +
//"<tr><td>configuration setup</td></tr>" +
//"<tr><td>service</td></tr>" +
//"<tr><td>add operator</td><td>fit.operators.executeempty</td></tr>" +
//"</table>" +
"<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsFixture</td></tr>" +
"<tr><td>field</td><td>save!</td></tr>" +
"<tr><td>a,b,c</td><td></td></tr>" +
"</table>";
string processedSetUpTableHtml =
//"<table>" +
//"<tr><td>configuration setup</td></tr>" +
//"<tr><td>service</td></tr>" +
//"<tr><td>add operator</td><td>fit.operators.executeempty</td></tr>" +
//"</table>" +
"<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsFixture</td></tr>" +
"<tr><td>field</td><td>save!</td></tr>" +
"<tr><td>a,b,c</td><td><span class=\"fit_grey\"> null</span></td></tr>" +
"</table>";
string tableHtml = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsRowFixture</td></tr>" +
"<tr><td>field</td></tr>" +
"<tr><td>a,b,c</td></tr>" +
"</table>";
string expected = "<table>" +
"<tr><td colspan=\"3\">ArrayOfStringsRowFixture</td></tr>" +
"<tr><td>field</td></tr>" +
"<tr><td class=\"pass\">a,b,c</td></tr>" +
"</table>";
Parse tables = new Parse(setUpTableHtml + tableHtml);
RunTest(tables);
var x = tables.ToString();
Assert.AreEqual(processedSetUpTableHtml + expected, tables.ToString());
}