Class Aver
Provides basic averments for test construction. May call Aver.Fail(msg) manually
Inheritance
System.Object
Aver
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos
Assembly: Azos.dll
Syntax
Methods
AreArrayObjectsEquivalent<T>(T[], T[], String)
Tests arrays for equivalance using element-by-element equality test based on object.Equals()
Declaration
public static void AreArrayObjectsEquivalent<T>(T[] expect, T[] got, string from = null)
where T : class
Parameters
Type |
Name |
Description |
T[] |
expect |
|
T[] |
got |
|
System.String |
from |
|
Type Parameters
AreArrayObjectsEquivalentTest<T>(T[], T[], out Int32)
Tests arrays for equivalance using element-by-element equality test based on object.Equals()
Declaration
public static bool AreArrayObjectsEquivalentTest<T>(T[] expect, T[] got, out int differenceIdx)
where T : class
Parameters
Type |
Name |
Description |
T[] |
expect |
|
T[] |
got |
|
System.Int32 |
differenceIdx |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
AreArraysEquivalent(Array, Array, String, IEqualityComparer<Object>)
Tests Arrays for equality via Array.SequenceEqual()
Declaration
public static void AreArraysEquivalent(Array expect, Array got, string from = null, IEqualityComparer<object> comparer = null)
Parameters
Type |
Name |
Description |
System.Array |
expect |
|
System.Array |
got |
|
System.String |
from |
|
System.Collections.Generic.IEqualityComparer<System.Object> |
comparer |
|
AreArraysEquivalent<T>(T[], T[], String, IEqualityComparer<T>)
Tests arrays of T : IEquatable(T) for equality - element by element
Declaration
public static void AreArraysEquivalent<T>(T[] expect, T[] got, string from = null, IEqualityComparer<T> comparer = null)
where T : IEquatable<T>
Parameters
Type |
Name |
Description |
T[] |
expect |
|
T[] |
got |
|
System.String |
from |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Type Parameters
AreArraysEquivalent<T>(Nullable<T>[], Nullable<T>[], String, IEqualityComparer<T>)
Tests arrays of T : IEquatable(T) for equality - element by element
Declaration
public static void AreArraysEquivalent<T>(T? [] expect, T? [] got, string from = null, IEqualityComparer<T> comparer = null)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Nullable<T>[] |
expect |
|
System.Nullable<T>[] |
got |
|
System.String |
from |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Type Parameters
AreArraysEquivalentTest(Array, Array, IEqualityComparer<Object>)
Tests Arrays for equality via Array.SequenceEqual()
Declaration
public static bool AreArraysEquivalentTest(Array expect, Array got, IEqualityComparer<object> comparer = null)
Parameters
Type |
Name |
Description |
System.Array |
expect |
|
System.Array |
got |
|
System.Collections.Generic.IEqualityComparer<System.Object> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
AreArraysEquivalentTest<T>(T[], T[], out Int32, IEqualityComparer<T>)
Tests arrays of T : IEquatable(T) for equality - element by element
Declaration
public static bool AreArraysEquivalentTest<T>(T[] expect, T[] got, out int differenceIdx, IEqualityComparer<T> comparer = null)
where T : IEquatable<T>
Parameters
Type |
Name |
Description |
T[] |
expect |
|
T[] |
got |
|
System.Int32 |
differenceIdx |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
AreArraysEquivalentTest<T>(Nullable<T>[], Nullable<T>[], out Int32, IEqualityComparer<T>)
Tests arrays of T : IEquatable(T) for equality - element by element
Declaration
public static bool AreArraysEquivalentTest<T>(T? [] expect, T? [] got, out int differenceIdx, IEqualityComparer<T> comparer = null)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Nullable<T>[] |
expect |
|
System.Nullable<T>[] |
got |
|
System.Int32 |
differenceIdx |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
AreEqual(String, String, String)
Declaration
public static void AreEqual(string expect, string got, string from = null)
Parameters
Type |
Name |
Description |
System.String |
expect |
|
System.String |
got |
|
System.String |
from |
|
AreEqual(String, String, StringComparison, String)
Declaration
public static void AreEqual(string expect, string got, StringComparison comparison, string from = null)
Parameters
Type |
Name |
Description |
System.String |
expect |
|
System.String |
got |
|
System.StringComparison |
comparison |
|
System.String |
from |
|
AreEqual<T>(T, T, String)
Declaration
public static void AreEqual<T>(T expect, T got, string from = null)
where T : IEquatable<T>
Parameters
Type |
Name |
Description |
T |
expect |
|
T |
got |
|
System.String |
from |
|
Type Parameters
AreEqual<T>(Nullable<T>, Nullable<T>, String)
Declaration
public static void AreEqual<T>(T? expect, T? got, string from = null)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Nullable<T> |
expect |
|
System.Nullable<T> |
got |
|
System.String |
from |
|
Type Parameters
AreEqualTest<T>(Nullable<T>, Nullable<T>)
Declaration
public static bool AreEqualTest<T>(T? expect, T? got)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Nullable<T> |
expect |
|
System.Nullable<T> |
got |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
AreNotEqual(String, String, String)
Declaration
public static void AreNotEqual(string expect, string got, string from = null)
Parameters
Type |
Name |
Description |
System.String |
expect |
|
System.String |
got |
|
System.String |
from |
|
AreNotEqual(String, String, StringComparison, String)
Declaration
public static void AreNotEqual(string expect, string got, StringComparison comparison, string from = null)
Parameters
Type |
Name |
Description |
System.String |
expect |
|
System.String |
got |
|
System.StringComparison |
comparison |
|
System.String |
from |
|
AreNotEqual<T>(T, T, String)
Declaration
public static void AreNotEqual<T>(T expect, T got, string from = null)
where T : IEquatable<T>
Parameters
Type |
Name |
Description |
T |
expect |
|
T |
got |
|
System.String |
from |
|
Type Parameters
AreNotEqual<T>(Nullable<T>, Nullable<T>, String)
Declaration
public static void AreNotEqual<T>(T? expect, T? got, string from = null)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
System.Nullable<T> |
expect |
|
System.Nullable<T> |
got |
|
System.String |
from |
|
Type Parameters
AreNotSameRef(Object, Object, String)
Declaration
public static void AreNotSameRef(object expect, object got, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
System.String |
from |
|
AreNotWithin(Decimal, Decimal, Decimal, String)
Declaration
public static void AreNotWithin(decimal expect, decimal got, decimal delta, string from = null)
Parameters
Type |
Name |
Description |
System.Decimal |
expect |
|
System.Decimal |
got |
|
System.Decimal |
delta |
|
System.String |
from |
|
AreNotWithin(Double, Double, Double, String)
Declaration
public static void AreNotWithin(double expect, double got, double delta, string from = null)
Parameters
Type |
Name |
Description |
System.Double |
expect |
|
System.Double |
got |
|
System.Double |
delta |
|
System.String |
from |
|
AreNotWithin(Single, Single, Single, String)
Declaration
public static void AreNotWithin(float expect, float got, float delta, string from = null)
Parameters
Type |
Name |
Description |
System.Single |
expect |
|
System.Single |
got |
|
System.Single |
delta |
|
System.String |
from |
|
AreObjectEqualTest(Object, Object)
Test for equality via object.Equals()only disregarding all other possible equality comparers like IEquatable etc...
Declaration
public static bool AreObjectEqualTest(object expect, object got)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
Returns
Type |
Description |
System.Boolean |
|
AreObjectsEqual(Object, Object, String)
Test for equality via object.Equals()only disregarding all other possible equality comparers like IEquatable etc...
Declaration
public static void AreObjectsEqual(object expect, object got, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
System.String |
from |
|
AreObjectsNotEqual(Object, Object, String)
Test for inequality via object.Equals()only disregarding all other possible equality comparers like IEquatable etc...
Declaration
public static void AreObjectsNotEqual(object expect, object got, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
System.String |
from |
|
AreSameRef(Object, Object, String)
Declaration
public static void AreSameRef(object expect, object got, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
System.String |
from |
|
AreSameRefTest(Object, Object)
Declaration
public static bool AreSameRefTest(object expect, object got)
Parameters
Type |
Name |
Description |
System.Object |
expect |
|
System.Object |
got |
|
Returns
Type |
Description |
System.Boolean |
|
AreWithin(Decimal, Decimal, Decimal, String)
Declaration
public static void AreWithin(decimal expect, decimal got, decimal delta, string from = null)
Parameters
Type |
Name |
Description |
System.Decimal |
expect |
|
System.Decimal |
got |
|
System.Decimal |
delta |
|
System.String |
from |
|
AreWithin(Double, Double, Double, String)
Declaration
public static void AreWithin(double expect, double got, double delta, string from = null)
Parameters
Type |
Name |
Description |
System.Double |
expect |
|
System.Double |
got |
|
System.Double |
delta |
|
System.String |
from |
|
AreWithin(Single, Single, Single, String)
Declaration
public static void AreWithin(float expect, float got, float delta, string from = null)
Parameters
Type |
Name |
Description |
System.Single |
expect |
|
System.Single |
got |
|
System.Single |
delta |
|
System.String |
from |
|
AreWithinTest(Decimal, Decimal, Decimal)
Declaration
public static bool AreWithinTest(decimal expect, decimal got, decimal delta)
Parameters
Type |
Name |
Description |
System.Decimal |
expect |
|
System.Decimal |
got |
|
System.Decimal |
delta |
|
Returns
Type |
Description |
System.Boolean |
|
AreWithinTest(Double, Double, Double)
Declaration
public static bool AreWithinTest(double expect, double got, double delta)
Parameters
Type |
Name |
Description |
System.Double |
expect |
|
System.Double |
got |
|
System.Double |
delta |
|
Returns
Type |
Description |
System.Boolean |
|
AreWithinTest(Single, Single, Single)
Declaration
public static bool AreWithinTest(float expect, float got, float delta)
Parameters
Type |
Name |
Description |
System.Single |
expect |
|
System.Single |
got |
|
System.Single |
delta |
|
Returns
Type |
Description |
System.Boolean |
|
Fail(String, String)
Fails averment by throwing AvermentException
Declaration
public static void Fail(string message, string from = null)
Parameters
Type |
Name |
Description |
System.String |
message |
|
System.String |
from |
|
IsFalse(Boolean, String)
Declaration
public static void IsFalse(bool condition, string from = null)
Parameters
Type |
Name |
Description |
System.Boolean |
condition |
|
System.String |
from |
|
IsNotNull(Object, String)
Declaration
public static void IsNotNull(object reference, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
reference |
|
System.String |
from |
|
IsNotNull<T>(Nullable<T>, String)
Declaration
public static void IsNotNull<T>(T? got, string from = null)
where T : struct
Parameters
Type |
Name |
Description |
System.Nullable<T> |
got |
|
System.String |
from |
|
Type Parameters
IsNull(Object, String)
Declaration
public static void IsNull(object reference, string from = null)
Parameters
Type |
Name |
Description |
System.Object |
reference |
|
System.String |
from |
|
IsNull<T>(Nullable<T>, String)
Declaration
public static void IsNull<T>(T? got, string from = null)
where T : struct
Parameters
Type |
Name |
Description |
System.Nullable<T> |
got |
|
System.String |
from |
|
Type Parameters
IsTrue(Boolean, String)
Declaration
public static void IsTrue(bool condition, string from = null)
Parameters
Type |
Name |
Description |
System.Boolean |
condition |
|
System.String |
from |
|
Pass(String, String)
Declaration
public static void Pass(string message = null, string from = null)
Parameters
Type |
Name |
Description |
System.String |
message |
|
System.String |
from |
|
Throws<TException>(Action, String)
Declaration
public static void Throws<TException>(Action action, string from = null)
where TException : Exception
Parameters
Type |
Name |
Description |
System.Action |
action |
|
System.String |
from |
|
Type Parameters
Name |
Description |
TException |
|
ThrowsTest<TException>(Action)
Declaration
public static bool ThrowsTest<TException>(Action a)
where TException : Exception
Parameters
Type |
Name |
Description |
System.Action |
a |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Name |
Description |
TException |
|