xUnit.net
|
Contains various static methods that are used to verify that conditions are met during the process of running tests. More...
Classes | |
class | RaisedEvent |
Represents a raised event after the fact. More... | |
Static Public Member Functions | |
static new bool | Equals (object a, object b) |
Do not call this method. More... | |
static new bool | ReferenceEquals (object a, object b) |
Do not call this method. More... | |
static void | False (bool condition) |
Verifies that the condition is false. More... | |
static void | False (bool? condition) |
Verifies that the condition is false. More... | |
static void | False (bool condition, string userMessage) |
Verifies that the condition is false. More... | |
static void | False (bool? condition, string userMessage) |
Verifies that the condition is false. More... | |
static void | True (bool condition) |
Verifies that an expression is true. More... | |
static void | True (bool? condition) |
Verifies that an expression is true. More... | |
static void | True (bool condition, string userMessage) |
Verifies that an expression is true. More... | |
static void | True (bool? condition, string userMessage) |
Verifies that an expression is true. More... | |
static void | All< T > (IEnumerable< T > collection, Action< T > action) |
Verifies that all items in the collection pass when executed against action. More... | |
static void | Collection< T > (IEnumerable< T > collection, params Action< T >[] elementInspectors) |
Verifies that a collection contains exactly a given number of elements, which meet the criteria provided by the element inspectors. More... | |
static void | Contains< T > (T expected, IEnumerable< T > collection) |
Verifies that a collection contains a given object. More... | |
static void | Contains< T > (T expected, IEnumerable< T > collection, IEqualityComparer< T > comparer) |
Verifies that a collection contains a given object, using an equality comparer. More... | |
static void | Contains< T > (IEnumerable< T > collection, Predicate< T > filter) |
Verifies that a collection contains a given object. More... | |
static TValue | Contains< TKey, TValue > (TKey expected, IReadOnlyDictionary< TKey, TValue > collection) |
Verifies that a dictionary contains a given key. More... | |
static TValue | Contains< TKey, TValue > (TKey expected, IDictionary< TKey, TValue > collection) |
Verifies that a dictionary contains a given key. More... | |
static void | DoesNotContain< T > (T expected, IEnumerable< T > collection) |
Verifies that a collection does not contain a given object. More... | |
static void | DoesNotContain< T > (T expected, IEnumerable< T > collection, IEqualityComparer< T > comparer) |
Verifies that a collection does not contain a given object, using an equality comparer. More... | |
static void | DoesNotContain< T > (IEnumerable< T > collection, Predicate< T > filter) |
Verifies that a collection does not contain a given object. More... | |
static void | DoesNotContain< TKey, TValue > (TKey expected, IReadOnlyDictionary< TKey, TValue > collection) |
Verifies that a dictionary does not contain a given key. More... | |
static void | DoesNotContain< TKey, TValue > (TKey expected, IDictionary< TKey, TValue > collection) |
Verifies that a dictionary does not contain a given key. More... | |
static void | Empty (IEnumerable collection) |
Verifies that a collection is empty. More... | |
static void | Equal< T > (IEnumerable< T > expected, IEnumerable< T > actual) |
Verifies that two sequences are equivalent, using a default comparer. More... | |
static void | Equal< T > (IEnumerable< T > expected, IEnumerable< T > actual, IEqualityComparer< T > comparer) |
Verifies that two sequences are equivalent, using a custom equatable comparer. More... | |
static void | NotEmpty (IEnumerable collection) |
Verifies that a collection is not empty. More... | |
static void | NotEqual< T > (IEnumerable< T > expected, IEnumerable< T > actual) |
Verifies that two sequences are not equivalent, using a default comparer. More... | |
static void | NotEqual< T > (IEnumerable< T > expected, IEnumerable< T > actual, IEqualityComparer< T > comparer) |
Verifies that two sequences are not equivalent, using a custom equality comparer. More... | |
static object | Single (IEnumerable collection) |
Verifies that the given collection contains only a single element of the given type. More... | |
static void | Single (IEnumerable collection, object expected) |
Verifies that the given collection contains only a single element of the given value. The collection may or may not contain other values. More... | |
static T | Single< T > (IEnumerable< T > collection) |
Verifies that the given collection contains only a single element of the given type. More... | |
static T | Single< T > (IEnumerable< T > collection, Predicate< T > predicate) |
Verifies that the given collection contains only a single element of the given type which matches the given predicate. The collection may or may not contain other values which do not match the given predicate. More... | |
static void | Equal< T > (T expected, T actual) |
Verifies that two objects are equal, using a default comparer. More... | |
static void | Equal< T > (T expected, T actual, IEqualityComparer< T > comparer) |
Verifies that two objects are equal, using a custom equatable comparer. More... | |
static void | Equal (double expected, double actual, int precision) |
Verifies that two double values are equal, within the number of decimal places given by precision . The values are rounded before comparison. More... | |
static void | Equal (decimal expected, decimal actual, int precision) |
Verifies that two decimal values are equal, within the number of decimal places given by precision . The values are rounded before comparison. More... | |
static void | Equal (DateTime expected, DateTime actual, TimeSpan precision) |
Verifies that two DateTime values are equal, within the precision given by precision . More... | |
static void | StrictEqual< T > (T expected, T actual) |
Verifies that two objects are strictly equal, using the type's default comparer. More... | |
static void | NotEqual< T > (T expected, T actual) |
Verifies that two objects are not equal, using a default comparer. More... | |
static void | NotEqual< T > (T expected, T actual, IEqualityComparer< T > comparer) |
Verifies that two objects are not equal, using a custom equality comparer. More... | |
static void | NotEqual (double expected, double actual, int precision) |
Verifies that two double values are not equal, within the number of decimal places given by precision . More... | |
static void | NotEqual (decimal expected, decimal actual, int precision) |
Verifies that two decimal values are not equal, within the number of decimal places given by precision . More... | |
static void | NotStrictEqual< T > (T expected, T actual) |
Verifies that two objects are strictly not equal, using the type's default comparer. More... | |
static RaisedEvent< T > | Raises< T > (Action< EventHandler< T >> attach, Action< EventHandler< T >> detach, Action testCode) |
Verifies that a event with the exact event args is raised. More... | |
static RaisedEvent< T > | RaisesAny< T > (Action< EventHandler< T >> attach, Action< EventHandler< T >> detach, Action testCode) |
Verifies that an event with the exact or a derived event args is raised. More... | |
static async Task< RaisedEvent< T > > | RaisesAsync< T > (Action< EventHandler< T >> attach, Action< EventHandler< T >> detach, Func< Task > testCode) |
Verifies that a event with the exact event args (and not a derived type) is raised. More... | |
static async Task< RaisedEvent< T > > | RaisesAnyAsync< T > (Action< EventHandler< T >> attach, Action< EventHandler< T >> detach, Func< Task > testCode) |
Verifies that an event with the exact or a derived event args is raised. More... | |
static T | Throws< T > (Action testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). More... | |
static T | Throws< T > (Func< object > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors. More... | |
static T | Throws< T > (Func< Task > testCode) |
static async Task< T > | ThrowsAsync< T > (Func< Task > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). More... | |
static T | ThrowsAny< T > (Action testCode) |
Verifies that the exact exception or a derived exception type is thrown. More... | |
static T | ThrowsAny< T > (Func< object > testCode) |
Verifies that the exact exception or a derived exception type is thrown. Generally used to test property accessors. More... | |
static async Task< T > | ThrowsAnyAsync< T > (Func< Task > testCode) |
Verifies that the exact exception or a derived exception type is thrown. More... | |
static Exception | Throws (Type exceptionType, Action testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). More... | |
static Exception | Throws (Type exceptionType, Func< object > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors. More... | |
static async Task< Exception > | ThrowsAsync (Type exceptionType, Func< Task > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type). More... | |
static T | Throws< T > (string paramName, Action testCode) |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name. More... | |
static T | Throws< T > (string paramName, Func< object > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name. More... | |
static T | Throws< T > (string paramName, Func< Task > testCode) |
static async Task< T > | ThrowsAsync< T > (string paramName, Func< Task > testCode) |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name. More... | |
static void | NotSame (object expected, object actual) |
Verifies that two objects are not the same instance. More... | |
static void | Same (object expected, object actual) |
Verifies that two objects are the same instance. More... | |
static void | NotNull (object @object) |
Verifies that an object reference is not null. More... | |
static void | Null (object @object) |
Verifies that an object reference is null. More... | |
static void | PropertyChanged (INotifyPropertyChanged @object, string propertyName, Action testCode) |
Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code. More... | |
static void | PropertyChanged (INotifyPropertyChanged @object, string propertyName, Func< Task > testCode) |
static async Task | PropertyChangedAsync (INotifyPropertyChanged @object, string propertyName, Func< Task > testCode) |
Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code. More... | |
static void | InRange< T > (T actual, T low, T high) |
Verifies that a value is within a given range. More... | |
static void | InRange< T > (T actual, T low, T high, IComparer< T > comparer) |
Verifies that a value is within a given range, using a comparer. More... | |
static void | NotInRange< T > (T actual, T low, T high) |
Verifies that a value is not within a given range, using the default comparer. More... | |
static void | NotInRange< T > (T actual, T low, T high, IComparer< T > comparer) |
Verifies that a value is not within a given range, using a comparer. More... | |
static void | ProperSubset< T > (ISet< T > expectedSuperset, ISet< T > actual) |
Verifies that a set is a proper subset of another set. More... | |
static void | ProperSuperset< T > (ISet< T > expectedSubset, ISet< T > actual) |
Verifies that a set is a proper superset of another set. More... | |
static void | Subset< T > (ISet< T > expectedSuperset, ISet< T > actual) |
Verifies that a set is a subset of another set. More... | |
static void | Superset< T > (ISet< T > expectedSubset, ISet< T > actual) |
Verifies that a set is a superset of another set. More... | |
static void | Contains (string expectedSubstring, string actualString) |
Verifies that a string contains a given sub-string, using the current culture. More... | |
static void | Contains (string expectedSubstring, string actualString, StringComparison comparisonType) |
Verifies that a string contains a given sub-string, using the given comparison type. More... | |
static void | DoesNotContain (string expectedSubstring, string actualString) |
Verifies that a string does not contain a given sub-string, using the current culture. More... | |
static void | DoesNotContain (string expectedSubstring, string actualString, StringComparison comparisonType) |
Verifies that a string does not contain a given sub-string, using the current culture. More... | |
static void | StartsWith (string expectedStartString, string actualString) |
Verifies that a string starts with a given string, using the current culture. More... | |
static void | StartsWith (string expectedStartString, string actualString, StringComparison comparisonType) |
Verifies that a string starts with a given string, using the given comparison type. More... | |
static void | EndsWith (string expectedEndString, string actualString) |
Verifies that a string ends with a given string, using the current culture. More... | |
static void | EndsWith (string expectedEndString, string actualString, StringComparison comparisonType) |
Verifies that a string ends with a given string, using the given comparison type. More... | |
static void | Matches (string expectedRegexPattern, string actualString) |
Verifies that a string matches a regular expression. More... | |
static void | Matches (Regex expectedRegex, string actualString) |
Verifies that a string matches a regular expression. More... | |
static void | DoesNotMatch (string expectedRegexPattern, string actualString) |
Verifies that a string does not match a regular expression. More... | |
static void | DoesNotMatch (Regex expectedRegex, string actualString) |
Verifies that a string does not match a regular expression. More... | |
static void | Equal (string expected, string actual) |
Verifies that two strings are equivalent. More... | |
static void | Equal (string expected, string actual, bool ignoreCase=false, bool ignoreLineEndingDifferences=false, bool ignoreWhiteSpaceDifferences=false) |
Verifies that two strings are equivalent. More... | |
static T | IsAssignableFrom< T > (object @object) |
Verifies that an object is of the given type or a derived type. More... | |
static void | IsAssignableFrom (Type expectedType, object @object) |
Verifies that an object is of the given type or a derived type. More... | |
static void | IsNotType< T > (object @object) |
Verifies that an object is not exactly the given type. More... | |
static void | IsNotType (Type expectedType, object @object) |
Verifies that an object is not exactly the given type. More... | |
static T | IsType< T > (object @object) |
Verifies that an object is exactly the given type (and not a derived type). More... | |
static void | IsType (Type expectedType, object @object) |
Verifies that an object is exactly the given type (and not a derived type). More... | |
Protected Member Functions | |
Assert () | |
Initializes a new instance of the Assert class. More... | |
Static Protected Member Functions | |
static Exception | RecordException (Action testCode) |
Records any exception which is thrown by the given code. More... | |
static Exception | RecordException (Func< object > testCode) |
Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors. More... | |
static Exception | RecordException (Func< Task > testCode) |
static async Task< Exception > | RecordExceptionAsync (Func< Task > testCode) |
Records any exception which is thrown by the given task. More... | |
Contains various static methods that are used to verify that conditions are met during the process of running tests.
|
inlineprotected |
Initializes a new instance of the Assert class.
|
inlinestatic |
Verifies that all items in the collection pass when executed against action.
T | The type of the object to be verified |
collection | The collection |
action | The action to test each item against |
AllException | Thrown when the collection contains at least one non-matching element |
|
inlinestatic |
Verifies that a collection contains exactly a given number of elements, which meet the criteria provided by the element inspectors.
T | The type of the object to be verified |
collection | The collection to be inspected |
elementInspectors | The element inspectors, which inspect each element in turn. The total number of element inspectors must exactly match the number of elements in the collection. |
|
inlinestatic |
Verifies that a string contains a given sub-string, using the current culture.
expectedSubstring | The sub-string expected to be in the string |
actualString | The string to be inspected |
ContainsException | Thrown when the sub-string is not present inside the string |
|
inlinestatic |
Verifies that a string contains a given sub-string, using the given comparison type.
expectedSubstring | The sub-string expected to be in the string |
actualString | The string to be inspected |
comparisonType | The type of string comparison to perform |
ContainsException | Thrown when the sub-string is not present inside the string |
|
inlinestatic |
Verifies that a collection contains a given object.
T | The type of the object to be verified |
expected | The object expected to be in the collection |
collection | The collection to be inspected |
ContainsException | Thrown when the object is not present in the collection |
|
inlinestatic |
Verifies that a collection contains a given object, using an equality comparer.
T | The type of the object to be verified |
expected | The object expected to be in the collection |
collection | The collection to be inspected |
comparer | The comparer used to equate objects in the collection with the expected object |
ContainsException | Thrown when the object is not present in the collection |
|
inlinestatic |
Verifies that a collection contains a given object.
T | The type of the object to be verified |
collection | The collection to be inspected |
filter | The filter used to find the item you're ensuring the collection contains |
ContainsException | Thrown when the object is not present in the collection |
|
inlinestatic |
Verifies that a dictionary contains a given key.
TKey | The type of the keys of the object to be verified. |
TValue | The type of the values of the object to be verified. |
expected | The object expected to be in the collection. |
collection | The collection to be inspected. |
ContainsException | Thrown when the object is not present in the collection |
|
inlinestatic |
Verifies that a dictionary contains a given key.
TKey | The type of the keys of the object to be verified. |
TValue | The type of the values of the object to be verified. |
expected | The object expected to be in the collection. |
collection | The collection to be inspected. |
ContainsException | Thrown when the object is not present in the collection |
|
inlinestatic |
Verifies that a string does not contain a given sub-string, using the current culture.
expectedSubstring | The sub-string which is expected not to be in the string |
actualString | The string to be inspected |
DoesNotContainException | Thrown when the sub-string is present inside the string |
|
inlinestatic |
Verifies that a string does not contain a given sub-string, using the current culture.
expectedSubstring | The sub-string which is expected not to be in the string |
actualString | The string to be inspected |
comparisonType | The type of string comparison to perform |
DoesNotContainException | Thrown when the sub-string is present inside the given string |
|
inlinestatic |
Verifies that a collection does not contain a given object.
T | The type of the object to be compared |
expected | The object that is expected not to be in the collection |
collection | The collection to be inspected |
DoesNotContainException | Thrown when the object is present inside the container |
|
inlinestatic |
Verifies that a collection does not contain a given object, using an equality comparer.
T | The type of the object to be compared |
expected | The object that is expected not to be in the collection |
collection | The collection to be inspected |
comparer | The comparer used to equate objects in the collection with the expected object |
DoesNotContainException | Thrown when the object is present inside the container |
|
inlinestatic |
Verifies that a collection does not contain a given object.
T | The type of the object to be compared |
collection | The collection to be inspected |
filter | The filter used to find the item you're ensuring the collection does not contain |
DoesNotContainException | Thrown when the object is present inside the container |
|
inlinestatic |
Verifies that a dictionary does not contain a given key.
TKey | The type of the keys of the object to be verified. |
TValue | The type of the values of the object to be verified. |
expected | The object expected to be in the collection. |
collection | The collection to be inspected. |
DoesNotContainException | Thrown when the object is present in the collection |
|
inlinestatic |
Verifies that a dictionary does not contain a given key.
TKey | The type of the keys of the object to be verified. |
TValue | The type of the values of the object to be verified. |
expected | The object expected to be in the collection. |
collection | The collection to be inspected. |
DoesNotContainException | Thrown when the object is present in the collection |
|
inlinestatic |
Verifies that a string does not match a regular expression.
expectedRegexPattern | The regex pattern expected not to match |
actualString | The string to be inspected |
DoesNotMatchException | Thrown when the string matches the regex pattern |
|
inlinestatic |
Verifies that a string does not match a regular expression.
expectedRegex | The regex expected not to match |
actualString | The string to be inspected |
DoesNotMatchException | Thrown when the string matches the regex |
|
inlinestatic |
Verifies that a collection is empty.
collection | The collection to be inspected |
ArgumentNullException | Thrown when the collection is null |
EmptyException | Thrown when the collection is not empty |
|
inlinestatic |
Verifies that a string ends with a given string, using the current culture.
expectedEndString | The string expected to be at the end of the string |
actualString | The string to be inspected |
ContainsException | Thrown when the string does not end with the expected string |
|
inlinestatic |
Verifies that a string ends with a given string, using the given comparison type.
expectedEndString | The string expected to be at the end of the string |
actualString | The string to be inspected |
comparisonType | The type of string comparison to perform |
ContainsException | Thrown when the string does not end with the expected string |
|
inlinestatic |
Verifies that two double values are equal, within the number of decimal places given by precision . The values are rounded before comparison.
expected | The expected value |
actual | The value to be compared against |
precision | The number of decimal places (valid values: 0-15) |
EqualException | Thrown when the values are not equal |
|
inlinestatic |
Verifies that two decimal values are equal, within the number of decimal places given by precision . The values are rounded before comparison.
expected | The expected value |
actual | The value to be compared against |
precision | The number of decimal places (valid values: 0-28) |
EqualException | Thrown when the values are not equal |
|
inlinestatic |
Verifies that two DateTime values are equal, within the precision given by precision .
expected | The expected value |
actual | The value to be compared against |
precision | The allowed difference in time where the two dates are considered equal |
EqualException | Thrown when the values are not equal |
|
inlinestatic |
Verifies that two strings are equivalent.
expected | The expected string value. |
actual | The actual string value. |
EqualException | Thrown when the strings are not equivalent. |
|
inlinestatic |
Verifies that two strings are equivalent.
expected | The expected string value. |
actual | The actual string value. |
ignoreCase | If set to true , ignores cases differences. The invariant culture is used. |
ignoreLineEndingDifferences | If set to true , treats \r, \r, and as equivalent. |
ignoreWhiteSpaceDifferences | If set to true , treats spaces and tabs (in any non-zero quantity) as equivalent. |
EqualException | Thrown when the strings are not equivalent. |
|
inlinestatic |
Verifies that two objects are equal, using a default comparer.
T | The type of the objects to be compared |
expected | The expected value |
actual | The value to be compared against |
EqualException | Thrown when the objects are not equal |
|
inlinestatic |
Verifies that two objects are equal, using a custom equatable comparer.
T | The type of the objects to be compared |
expected | The expected value |
actual | The value to be compared against |
comparer | The comparer used to compare the two objects |
EqualException | Thrown when the objects are not equal |
|
inlinestatic |
Verifies that two sequences are equivalent, using a default comparer.
T | The type of the objects to be compared |
expected | The expected value |
actual | The value to be compared against |
EqualException | Thrown when the objects are not equal |
|
inlinestatic |
Verifies that two sequences are equivalent, using a custom equatable comparer.
T | The type of the objects to be compared |
expected | The expected value |
actual | The value to be compared against |
comparer | The comparer used to compare the two objects |
EqualException | Thrown when the objects are not equal |
|
inlinestatic |
Do not call this method.
|
inlinestatic |
Verifies that the condition is false.
condition | The condition to be tested |
FalseException | Thrown if the condition is not false |
|
inlinestatic |
Verifies that the condition is false.
condition | The condition to be tested |
FalseException | Thrown if the condition is not false |
|
inlinestatic |
Verifies that the condition is false.
condition | The condition to be tested |
userMessage | The message to show when the condition is not false |
FalseException | Thrown if the condition is not false |
|
inlinestatic |
Verifies that the condition is false.
condition | The condition to be tested |
userMessage | The message to show when the condition is not false |
FalseException | Thrown if the condition is not false |
|
inlinestatic |
Verifies that a value is within a given range.
T | The type of the value to be compared |
actual | The actual value to be evaluated |
low | The (inclusive) low value of the range |
high | The (inclusive) high value of the range |
InRangeException | Thrown when the value is not in the given range |
T | : | IComparable |
|
inlinestatic |
Verifies that a value is within a given range, using a comparer.
T | The type of the value to be compared |
actual | The actual value to be evaluated |
low | The (inclusive) low value of the range |
high | The (inclusive) high value of the range |
comparer | The comparer used to evaluate the value's range |
InRangeException | Thrown when the value is not in the given range |
|
inlinestatic |
Verifies that an object is of the given type or a derived type.
expectedType | The type the object should be |
object | The object to be evaluated |
IsAssignableFromException | Thrown when the object is not the given type |
|
inlinestatic |
Verifies that an object is of the given type or a derived type.
T | The type the object should be |
object | The object to be evaluated |
IsAssignableFromException | Thrown when the object is not the given type |
|
inlinestatic |
Verifies that an object is not exactly the given type.
expectedType | The type the object should not be |
object | The object to be evaluated |
IsNotTypeException | Thrown when the object is the given type |
|
inlinestatic |
Verifies that an object is not exactly the given type.
T | The type the object should not be |
object | The object to be evaluated |
IsNotTypeException | Thrown when the object is the given type |
|
inlinestatic |
Verifies that an object is exactly the given type (and not a derived type).
expectedType | The type the object should be |
object | The object to be evaluated |
IsTypeException | Thrown when the object is not the given type |
|
inlinestatic |
Verifies that an object is exactly the given type (and not a derived type).
T | The type the object should be |
object | The object to be evaluated |
IsTypeException | Thrown when the object is not the given type |
|
inlinestatic |
Verifies that a string matches a regular expression.
expectedRegexPattern | The regex pattern expected to match |
actualString | The string to be inspected |
MatchesException | Thrown when the string does not match the regex pattern |
|
inlinestatic |
Verifies that a string matches a regular expression.
expectedRegex | The regex expected to match |
actualString | The string to be inspected |
MatchesException | Thrown when the string does not match the regex |
|
inlinestatic |
Verifies that a collection is not empty.
collection | The collection to be inspected |
ArgumentNullException | Thrown when a null collection is passed |
NotEmptyException | Thrown when the collection is empty |
|
inlinestatic |
Verifies that two double values are not equal, within the number of decimal places given by precision .
expected | The expected value |
actual | The value to be compared against |
precision | The number of decimal places (valid values: 0-15) |
EqualException | Thrown when the values are equal |
|
inlinestatic |
Verifies that two decimal values are not equal, within the number of decimal places given by precision .
expected | The expected value |
actual | The value to be compared against |
precision | The number of decimal places (valid values: 0-28) |
EqualException | Thrown when the values are equal |
|
inlinestatic |
Verifies that two objects are not equal, using a default comparer.
T | The type of the objects to be compared |
expected | The expected object |
actual | The actual object |
NotEqualException | Thrown when the objects are equal |
|
inlinestatic |
Verifies that two objects are not equal, using a custom equality comparer.
T | The type of the objects to be compared |
expected | The expected object |
actual | The actual object |
comparer | The comparer used to examine the objects |
NotEqualException | Thrown when the objects are equal |
|
inlinestatic |
Verifies that two sequences are not equivalent, using a default comparer.
T | The type of the objects to be compared |
expected | The expected object |
actual | The actual object |
NotEqualException | Thrown when the objects are equal |
|
inlinestatic |
Verifies that two sequences are not equivalent, using a custom equality comparer.
T | The type of the objects to be compared |
expected | The expected object |
actual | The actual object |
comparer | The comparer used to compare the two objects |
NotEqualException | Thrown when the objects are equal |
|
inlinestatic |
Verifies that a value is not within a given range, using the default comparer.
T | The type of the value to be compared |
actual | The actual value to be evaluated |
low | The (inclusive) low value of the range |
high | The (inclusive) high value of the range |
NotInRangeException | Thrown when the value is in the given range |
T | : | IComparable |
|
inlinestatic |
Verifies that a value is not within a given range, using a comparer.
T | The type of the value to be compared |
actual | The actual value to be evaluated |
low | The (inclusive) low value of the range |
high | The (inclusive) high value of the range |
comparer | The comparer used to evaluate the value's range |
NotInRangeException | Thrown when the value is in the given range |
|
inlinestatic |
Verifies that an object reference is not null.
object | The object to be validated |
NotNullException | Thrown when the object is not null |
|
inlinestatic |
Verifies that two objects are not the same instance.
expected | The expected object instance |
actual | The actual object instance |
NotSameException | Thrown when the objects are the same instance |
|
inlinestatic |
Verifies that two objects are strictly not equal, using the type's default comparer.
T | The type of the objects to be compared |
expected | The expected object |
actual | The actual object |
NotEqualException | Thrown when the objects are equal |
|
inlinestatic |
Verifies that an object reference is null.
object | The object to be inspected |
NullException | Thrown when the object reference is not null |
|
inlinestatic |
Verifies that a set is a proper subset of another set.
T | The type of the object to be verified |
expectedSuperset | The expected superset |
actual | The set expected to be a proper subset |
ContainsException | Thrown when the actual set is not a proper subset of the expected set |
|
inlinestatic |
Verifies that a set is a proper superset of another set.
T | The type of the object to be verified |
expectedSubset | The expected subset |
actual | The set expected to be a proper superset |
ContainsException | Thrown when the actual set is not a proper superset of the expected set |
|
inlinestatic |
Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code.
object | The object which should raise the notification |
propertyName | The property name for which the notification should be raised |
testCode | The test code which should cause the notification to be raised |
PropertyChangedException | Thrown when the notification is not raised |
|
inlinestatic |
Verifies that the provided object raised INotifyPropertyChanged.PropertyChanged as a result of executing the given test code.
object | The object which should raise the notification |
propertyName | The property name for which the notification should be raised |
testCode | The test code which should cause the notification to be raised |
PropertyChangedException | Thrown when the notification is not raised |
|
inlinestatic |
Verifies that a event with the exact event args is raised.
T | The type of the event arguments to expect |
attach | Code to attach the event handler |
detach | Code to detach the event handler |
testCode | A delegate to the code to be tested |
RaisesException | Thrown when the expected event was not raised. |
T | : | EventArgs |
|
inlinestatic |
Verifies that an event with the exact or a derived event args is raised.
T | The type of the event arguments to expect |
attach | Code to attach the event handler |
detach | Code to detach the event handler |
testCode | A delegate to the code to be tested |
RaisesException | Thrown when the expected event was not raised. |
T | : | EventArgs |
|
inlinestatic |
Verifies that an event with the exact or a derived event args is raised.
T | The type of the event arguments to expect |
attach | Code to attach the event handler |
detach | Code to detach the event handler |
testCode | A delegate to the code to be tested |
RaisesException | Thrown when the expected event was not raised. |
T | : | EventArgs |
|
inlinestatic |
Verifies that a event with the exact event args (and not a derived type) is raised.
T | The type of the event arguments to expect |
attach | Code to attach the event handler |
detach | Code to detach the event handler |
testCode | A delegate to the code to be tested |
RaisesException | Thrown when the expected event was not raised. |
T | : | EventArgs |
|
inlinestaticprotected |
Records any exception which is thrown by the given code.
testCode | The code which may thrown an exception. |
|
inlinestaticprotected |
Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors.
testCode | The code which may thrown an exception. |
|
inlinestaticprotected |
Records any exception which is thrown by the given task.
testCode | The task which may thrown an exception. |
|
inlinestatic |
Do not call this method.
|
inlinestatic |
Verifies that two objects are the same instance.
expected | The expected object instance |
actual | The actual object instance |
SameException | Thrown when the objects are not the same instance |
|
inlinestatic |
Verifies that the given collection contains only a single element of the given type.
collection | The collection. |
SingleException | Thrown when the collection does not contain exactly one element. |
|
inlinestatic |
Verifies that the given collection contains only a single element of the given value. The collection may or may not contain other values.
collection | The collection. |
expected | The value to find in the collection. |
SingleException | Thrown when the collection does not contain exactly one element. |
|
inlinestatic |
Verifies that the given collection contains only a single element of the given type.
T | The collection type. |
collection | The collection. |
SingleException | Thrown when the collection does not contain exactly one element. |
|
inlinestatic |
Verifies that the given collection contains only a single element of the given type which matches the given predicate. The collection may or may not contain other values which do not match the given predicate.
T | The collection type. |
collection | The collection. |
predicate | The item matching predicate. |
SingleException | Thrown when the filtered collection does not contain exactly one element. |
|
inlinestatic |
Verifies that a string starts with a given string, using the current culture.
expectedStartString | The string expected to be at the start of the string |
actualString | The string to be inspected |
ContainsException | Thrown when the string does not start with the expected string |
|
inlinestatic |
Verifies that a string starts with a given string, using the given comparison type.
expectedStartString | The string expected to be at the start of the string |
actualString | The string to be inspected |
comparisonType | The type of string comparison to perform |
ContainsException | Thrown when the string does not start with the expected string |
|
inlinestatic |
Verifies that two objects are strictly equal, using the type's default comparer.
T | The type of the objects to be compared |
expected | The expected value |
actual | The value to be compared against |
EqualException | Thrown when the objects are not equal |
|
inlinestatic |
Verifies that a set is a subset of another set.
T | The type of the object to be verified |
expectedSuperset | The expected superset |
actual | The set expected to be a subset |
ContainsException | Thrown when the actual set is not a subset of the expected set |
|
inlinestatic |
Verifies that a set is a superset of another set.
T | The type of the object to be verified |
expectedSubset | The expected subset |
actual | The set expected to be a superset |
ContainsException | Thrown when the actual set is not a superset of the expected set |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type).
exceptionType | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors.
exceptionType | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type).
T | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type). Generally used to test property accessors.
T | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name.
paramName | The parameter name that is expected to be in the exception |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | ArgumentException |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name.
paramName | The parameter name that is expected to be in the exception |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | ArgumentException |
|
inlinestatic |
Verifies that the exact exception or a derived exception type is thrown.
T | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception or a derived exception type is thrown. Generally used to test property accessors.
T | The type of the exception expected to be thrown |
testCode | A delegate to the code to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception or a derived exception type is thrown.
T | The type of the exception expected to be thrown |
testCode | A delegate to the task to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type).
exceptionType | The type of the exception expected to be thrown |
testCode | A delegate to the task to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type).
T | The type of the exception expected to be thrown |
testCode | A delegate to the task to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | Exception |
|
inlinestatic |
Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from ArgumentException and has the given parameter name.
paramName | The parameter name that is expected to be in the exception |
testCode | A delegate to the task to be tested |
ThrowsException | Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown |
T | : | ArgumentException |
|
inlinestatic |
Verifies that an expression is true.
condition | The condition to be inspected |
TrueException | Thrown when the condition is false |
|
inlinestatic |
Verifies that an expression is true.
condition | The condition to be inspected |
TrueException | Thrown when the condition is false |
|
inlinestatic |
Verifies that an expression is true.
condition | The condition to be inspected |
userMessage | The message to be shown when the condition is false |
TrueException | Thrown when the condition is false |
|
inlinestatic |
Verifies that an expression is true.
condition | The condition to be inspected |
userMessage | The message to be shown when the condition is false |
TrueException | Thrown when the condition is false |