Class XunitAssertions
This class contains several common assert patterns used throughout this testkit.
Implements
Inherited Members
Namespace: Akka.TestKit.Xunit2
Assembly: Akka.TestKit.Xunit2.dll
Syntax
public class XunitAssertions : ITestKitAssertions
Methods
| Improve this Doc View SourceAssertEqual<T>(T, T, Func<T, T, Boolean>, String, Object[])
Verifies that the two specified values (expected
and actual
are equal using a specified comparison function comparer
.
Declaration
public void AssertEqual<T>(T expected, T actual, Func<T, T, bool> comparer, string format = "", params object[] args)
Parameters
Type | Name | Description |
---|---|---|
T | expected | The expected value of the object |
T | actual | The actual value of the object |
Func<T, T, Boolean> | comparer | The function used to compare the two specified values. |
String | format | A template string to display if the assertion fails. |
Object[] | args | An optional object array that contains zero or more objects to format. |
Type Parameters
Name | Description |
---|---|
T | The type that is being compared. |
Exceptions
Type | Condition |
---|---|
AkkaEqualException | This exception is thrown when the two specified values are not equal. |
AssertEqual<T>(T, T, String, Object[])
Verifies that the two specified values (expected
and actual
are equal using the built-in comparison function AkkaAssertEqualityComparer<T>.
Declaration
public void AssertEqual<T>(T expected, T actual, string format = "", params object[] args)
Parameters
Type | Name | Description |
---|---|---|
T | expected | The expected value of the object |
T | actual | The actual value of the object |
String | format | A template string to display if the assertion fails. |
Object[] | args | An optional object array that contains zero or more objects to format. |
Type Parameters
Name | Description |
---|---|
T | The type that is being compared. |
Exceptions
Type | Condition |
---|---|
AkkaEqualException | This exception is thrown when the two specified values are not equal. |
AssertFalse(Boolean, String, Object[])
Verifies that a specified condition
is false.
Declaration
public void AssertFalse(bool condition, string format = "", params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | The condition that is being verified. |
String | format | A template string to display if the assertion fails. |
Object[] | args | An optional object array that contains zero or more objects to format. |
AssertTrue(Boolean, String, Object[])
Verifies that a specified condition
is true.
Declaration
public void AssertTrue(bool condition, string format = "", params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | The condition that is being verified. |
String | format | A template string to display if the assertion fails. |
Object[] | args | An optional object array that contains zero or more objects to format. |
Fail(String, Object[])
Fails an assertion without checking any conditions.
Declaration
public void Fail(string format = "", params object[] args)
Parameters
Type | Name | Description |
---|---|---|
String | format | A template string to display if the assertion fails. |
Object[] | args | An optional object array that contains zero or more objects to format. |