Пример #1
0
 /// <summary>
 /// '{0}' is NOT equal to {1} and it should be.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="expected"></param>
 /// <param name="actual"></param>
 /// <returns>Violation message</returns>
 internal static Violation WhenNotEqual <TExpected, TActual>([JetBrains.Annotations.NotNull][System.Diagnostics.CodeAnalysis.NotNull] string name, [CanBeNull] TExpected expected, [CanBeNull] TActual actual) =>
 Violation.Of("'{0}' ({2}) is NOT equal to {1} and it should be.", name, Violation.FormatValue(expected), Violation.FormatValue(actual));
Пример #2
0
 /// <summary>
 /// "Argument '{0}' is equal to {1} and it should NOT be."
 /// </summary>
 /// <param name="name"></param>
 /// <param name="unexpected"></param>
 /// <returns>Violation message</returns>
 internal static Violation WhenArgumentEqual <T>([JetBrains.Annotations.NotNull][System.Diagnostics.CodeAnalysis.NotNull] string name, [CanBeNull] T unexpected) =>
 Violation.Of("Argument '{0}' is equal to {1} and it should NOT be.", name, Violation.FormatValue(unexpected));