Search Results for

    Show / Hide Table of Contents

    Class XunitAssertions

    This class contains several common assert patterns used throughout this testkit.

    Inheritance
    object
    XunitAssertions
    Implements
    ITestKitAssertions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.TestKit.Xunit
    Assembly: Akka.TestKit.Xunit.dll
    Syntax
    public class XunitAssertions : ITestKitAssertions

    Methods

    | Edit this page View Source

    AssertEqual<T>(T, T, Func<T, T, bool>, string, params 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, bool> 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.

    | Edit this page View Source

    AssertEqual<T>(T, T, string, params 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.

    | Edit this page View Source

    AssertFalse(bool, string, params object[])

    Verifies that a specified condition is false.

    Declaration
    public void AssertFalse(bool condition, string format = "", params object[] args)
    Parameters
    Type Name Description
    bool 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.

    | Edit this page View Source

    AssertTrue(bool, string, params object[])

    Verifies that a specified condition is true.

    Declaration
    public void AssertTrue(bool condition, string format = "", params object[] args)
    Parameters
    Type Name Description
    bool 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.

    | Edit this page View Source

    Fail(string, params 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.

    Implements

    ITestKitAssertions

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET