Class CMSAssert
Custom assertions
public class CMSAssert
- Inheritance
-
objectCMSAssert
- Extension Methods
Constructors
CMSAssert()
public CMSAssert()
Methods
All(params Action[])
Execute multiple assertions
public static void All(params Action[] assertionsToRun)
Parameters
assertionsToRun
Action[]Assertions to be executed
ForEach<T>(IEnumerable<T>, Action<T>)
Asserts the given expression for each item in the given collection
public static void ForEach<T>(IEnumerable<T> items, Action<T> action)
Parameters
items
IEnumerable<T>Items to assert
action
Action<T>Assert action for the item
Type Parameters
T
InThreads(int, Action<int>)
Runs multiple actions in the given number of threads and reports all failed assertions and errors
[Obsolete("Method was not intended for public use and will be removed in the next version. Use custom assert instead.")]
public static IEnumerable<Thread> InThreads(int count, Action<int> action)
Parameters
count
intThreads count
action
Action<int>Thread action
Returns
- IEnumerable<Thread>
PathEquals(string, string, bool)
Asserts whether two paths are equal
public static void PathEquals(string expected, string actual, bool normalizeExpectedPathDelimiters = true)
Parameters
expected
stringExpected path
actual
stringCurrent path
normalizeExpectedPathDelimiters
boolIf true, all backslash symbols in
expected
are normalized to System.IO.Path.DirectorySeparatorChar
PropertyValuesEqual(object, object)
Asserts two objects by comparing their property values
public static void PropertyValuesEqual(object actual, object expected)
Parameters
actual
objectCurrent object
expected
objectExpected object
QueryEquals(WhereCondition, string, string)
Asserts whether two queries equal
public static void QueryEquals(WhereCondition current, string expected, string message = null)
Parameters
current
WhereConditionCurrent query
expected
stringExpected query
message
stringOptional error message
QueryEquals(string, string, string)
Asserts whether two queries equal
public static void QueryEquals(string current, string expected, string message = null)
Parameters
current
stringCurrent query
expected
stringExpected query
message
stringOptional error message
TextEquals(string, string, string, TextNormalizationSettings)
Asserts whether two queries equal
public static void TextEquals(string current, string expected, string message = null, TextNormalizationSettings settings = null)
Parameters
current
stringCurrent query
expected
stringExpected query
message
stringOptional error message
settings
TextNormalizationSettingsText normalization settings
WithMessage(string, Action)
Executes assertion and adds additional message if assertion fails
[Obsolete("Method was not intended for public use and will be removed in the next version. Use custom assert instead.")]
public static void WithMessage(string message, Action assertionToRun)
Parameters
message
stringExtra message in case assertion fails
assertionToRun
ActionAssertion to be executed