本文整理汇总了C#中QueryToken.ToDebugString方法的典型用法代码示例。如果您正苦于以下问题:C# QueryToken.ToDebugString方法的具体用法?C# QueryToken.ToDebugString怎么用?C# QueryToken.ToDebugString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryToken
的用法示例。
在下文中一共展示了QueryToken.ToDebugString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyQueryTokensAreEqual
/// <summary>
/// Verifies that two query tokens are equal.
/// </summary>
/// <param name="expected">The expected query token.</param>
/// <param name="actual">The actual query token.</param>
/// <param name="assert">Assertion handler to use.</param>
internal static void VerifyQueryTokensAreEqual(QueryToken expected, QueryToken actual, AssertionHandler assert)
{
try
{
if(!VerifyNullnessMatches(expected, actual, assert, "token")) return;
assert.AreEqual(expected.Kind, actual.Kind, "The token kinds are different.");
switch (expected.Kind)
{
case QueryTokenKind.Literal:
VerifyLiteralQueryTokensAreEqual((LiteralToken)expected, (LiteralToken)actual, assert);
break;
case QueryTokenKind.BinaryOperator:
VerifyBinaryOperatorQueryTokensAreEqual((BinaryOperatorToken)expected, (BinaryOperatorToken)actual, assert);
break;
case QueryTokenKind.UnaryOperator:
VerifyUnaryOperatorQueryTokensAreEqual((UnaryOperatorToken)expected, (UnaryOperatorToken)actual, assert);
break;
case QueryTokenKind.EndPath:
VerifyPropertyAccessQueryTokensAreEqual((EndPathToken)expected, (EndPathToken)actual, assert);
break;
case QueryTokenKind.InnerPath:
VerifyNonRootSegmentQueryTokensAreEqual((InnerPathToken) expected,(InnerPathToken) actual, assert);
break;
case QueryTokenKind.FunctionCall:
VerifyFunctionCallQueryTokensAreEqual((FunctionCallToken)expected, (FunctionCallToken)actual, assert);
break;
case QueryTokenKind.CustomQueryOption:
VerifyCustomQueryOptionQueryTokensAreEqual((CustomQueryOptionToken)expected, (CustomQueryOptionToken)actual, assert);
break;
case QueryTokenKind.OrderBy:
VerifyOrderByQueryTokensAreEqual((OrderByToken)expected, (OrderByToken)actual, assert);
break;
case QueryTokenKind.Select:
VerifySelectQueryTokensAreEqual((SelectToken)expected, (SelectToken)actual, assert);
break;
case QueryTokenKind.Star:
VerifyStarQueryTokensAreEqual((StarToken)expected, (StarToken)actual, assert);
break;
case QueryTokenKind.FunctionParameter:
VerifyFunctionParameterTokensAreEqual((FunctionParameterToken)expected, (FunctionParameterToken)actual, assert);
break;
default:
assert.Fail("The token kind '" + expected.Kind.ToString() + "' is not a lexical node.");
break;
}
}
catch (Exception)
{
assert.Warn("Expected query token: " + expected.ToDebugString());
assert.Warn("Actual query token: " + actual.ToDebugString());
throw;
}
}