-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FsUnit does not work with Result #189
Comments
Hello @purkhusid, FsUnit.Xunit+MatchException : Exception of type 'FsUnit.Xunit+MatchException' was thrown.
Expected: Equals Error (ThisIsAnError "yeehaw")
Actual: Ok "yeehaw" The expected [<Fact>]
let ``Testing stuff`` () =
// Arrange
let expectedError : Result<string, DomainError> =
Error(DomainError.ThisIsAnError("yo"))
// Act
let result : Result<string, DomainError> =
doStuff 0
// Assert
result |> should equal expectedError In your example the compiler doesn't "know" your type in expectedError ( We already had that topic last year, see this post: #146 (comment) I hope that helps. I'm hearing from you! |
Hey! Thanks for taking your time responding to my issue! I figured that I just needed the type annotations, thanks again for taking your time! |
Description
FsUnit does not work with Result type
Repro steps
Please provide the steps required to reproduce the problem
Expected behavior
The test should pass
Actual behavior
Fails with
Related information
Using FsUnit.Xunit 4.0.4
The text was updated successfully, but these errors were encountered: