Header menu logo testify

Integrations

Testify is not tied to one test framework.

The current library ships focused integration helpers for:

The integrations exist so you can keep Testify’s richer failure model instead of flattening everything to a generic assertion string.

MSTest

Use:

Example:

open Microsoft.VisualStudio.TestTools.UnitTesting
open Testify
open Testify.MSTest
open Testify.AssertOperators

[<TestifyClass>]
type DemoTests() =
    [<TestifyMethod>]
    member _.``addition`` () =
        <@ 1 + 2 @> =? 3

MSTest is a good fit when:

Expecto

Use:

Example:

open Expecto
open Testify
open Testify.Expecto
open Testify.AssertOperators

[<Tests>]
let tests =
    TestifyExpecto.testList "samples" [
        TestifyExpecto.testCase "addition" (fun () ->
            <@ 1 + 2 @> =? 3)
    ]

Expecto is a good fit when:

Which One Should You Choose?

Choose MSTest when:

Choose Expecto when:

Choose based on the host test framework, not because Testify itself changes meaning between them. The core Assert, Check, expectation, operator, hint, and reporting concepts stay the same.

Why The Integrations Exist

The integrations mainly do two things:

Use the API reference for the exact attribute/helper signatures.

namespace Microsoft
Multiple items
type DemoTests = new: unit -> DemoTests member addition: unit -> 'a

--------------------
new: unit -> DemoTests
val tests: obj

Type something to start searching.