本文整理汇总了C#中QueryString.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# QueryString.Equals方法的具体用法?C# QueryString.Equals怎么用?C# QueryString.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryString
的用法示例。
在下文中一共展示了QueryString.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertEqual
private static void AssertEqual(QueryString expected, QueryString actual)
{
Assert.IsTrue(expected.Equals(actual), "Expected: " + expected + "\nActual: " + actual);
Assert.IsTrue(expected.Equals(QueryString.Parse(actual.ToString())), "After serializing and parsing actual, result changed.\n\nExpected: " + expected + "\nActual: " + QueryString.Parse(actual.ToString()));
Assert.IsTrue(QueryString.Parse(expected.ToString()).Equals(actual), "After serializing and parsing expected, result changed.\n\nExpected: " + QueryString.Parse(expected.ToString()) + "\nActual: " + actual);
Assert.IsTrue(QueryString.Parse(expected.ToString()).Equals(QueryString.Parse(actual.ToString())), "After serializing and parsing both, result changed.\n\nExpected: " + QueryString.Parse(expected.ToString()) + "\nActual: " + QueryString.Parse(actual.ToString()));
}
示例2: AssertNotEqual
private static void AssertNotEqual(QueryString queryString1, QueryString queryString2)
{
Assert.IsFalse(queryString1.Equals(queryString2), "First: " + queryString1 + "\nSecond: " + queryString2);
Assert.IsFalse(queryString1.Equals(QueryString.Parse(queryString2.ToString())), "After serializing and parsing actual, result changed.\n\nFirst: " + queryString1 + "\nSecond: " + queryString2);
Assert.IsFalse(QueryString.Parse(queryString1.ToString()).Equals(queryString2), "After serializing and parsing expected, result changed.\n\nFirst: " + queryString1 + "\nSecond: " + queryString2);
Assert.IsFalse(QueryString.Parse(queryString1.ToString()).Equals(QueryString.Parse(queryString2.ToString())), "After serializing and parsing both, result changed.\n\nFirst: " + queryString1 + "\nSecond: " + queryString2);
}
示例3: AssertParse
private static void AssertParse(QueryString expected, string inputQueryString)
{
Assert.IsTrue(expected.Equals(QueryString.Parse(inputQueryString)), "Expected: " + expected + "\nActual: " + inputQueryString);
if (inputQueryString != null)
Assert.IsTrue(expected.Equals(QueryString.Parse(inputQueryString.Replace('&', ';'))), "Expected: " + expected + "\nActual: " + inputQueryString);
}