Skip to content

[Suggestion] Remove FsUnitTyped dependency on FsUnit #304

Description

@Lanayx

Hi! I'm suggesting that for FsUnitTyped it's possible to not depend on FsUnit primitives and rather call native assertions instead. That will benefit performance, stack traces and messages. For example today:

[<Fact>]
let ``Test fsunit`` () =
    let x = [1]
    x |> shouldContain 2
Xunit.Sdk.EqualException
Assert.Equal() Failure: Values differ
Expected: Contains 2
Actual:   [1]
   at FsUnit.Xunit.raiseEqualException@16[b](StringDescription description, String value)
   at FsUnitTyped.TopLevelOperators.shouldContain[a](a expected, IEnumerable`1 actual)
   at MyTests.Test fsunit()
[<Fact>]
let ``Test native``() =
    let x = [1]
    Assert.Contains(2, x)
Xunit.Sdk.ContainsException
Assert.Contains() Failure: Item not found in collection
Collection: [1]
Not found:  2
   at MyTests.Test native()

If this change is not desired - it's not a problem, I can create a compatible package FsUnit.Light with only typed primitives over native assertions. Just wanted to check if this is something you are interested as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions