Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4543562
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:32:55+00:00 2026-05-21T15:32:55+00:00

I am looking specifically for frameworks that allow me to take advantage of unique

  • 0

I am looking specifically for frameworks that allow me to take advantage of unique features of the language. I am aware of FsUnit. Would you recommend something else, and why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:32:56+00:00Added an answer on May 21, 2026 at 3:32 pm

    My own unit testing library, Unquote, takes advantage of F# quotations to allow you to write test assertions as plain, statically checked F# boolean expressions and automatically produces nice step-by-step test failure messages. For example, the following failing xUnit test

    [<Fact>]
    let ``demo Unquote xUnit support`` () =
        test <@ ([3; 2; 1; 0] |> List.map ((+) 1)) = [1 + 3..1 + 0] @>
    

    produces the following failure message

    Test 'Module.demo Unquote xUnit support' failed: 
    
    ([3; 2; 1; 0] |> List.map ((+) 1)) = [1 + 3..1 + 0]
    [4; 3; 2; 1] = [4..1]
    [4; 3; 2; 1] = []
    false
    
            C:\File.fs(28,0): at Module.demo Unquote xUnit support()
    

    FsUnit and Unquote have similar missions: to allow you to write tests in an idiomatic way, and to produce informative failure messages. But FsUnit is really just a small wrapper around NUnit Constraints, creating a DSL which hides object construction behind composable function calls. But it comes at a cost: you lose static type checking in your assertions. For example, the following is valid in FsUnit

    [<Test>]
    let test1 () =
        1 |> should not (equal "2")
    

    But with Unquote, you get all of F#’s static type-checking features so the equivalent assertion would not even compile, preventing us from introducing a bug in our test code

    [<Test>] //yes, Unquote supports both xUnit and NUnit automatically
    let test2 () =
        test <@ 1 <> "2" @> //simple assertions may be written more concisely, e.g. 1 <>! "2"
        //           ^^^
        //Error 22 This expression was expected to have type int but here has type string
    

    Also, since quotations are able to capture more information at compile time about an assertion expression, failure messages are a lot richer too. For example the failing FsUnit assertion 1 |> should not (equal 1) produces the message

    Test 'Test.Swensen.Unquote.VerifyNunitSupport.test1' failed: 
      Expected: not 1
      But was:  1
        C:\Users\Stephen\Documents\Visual Studio 2010\Projects\Unquote\VerifyNunitSupport\FsUnit.fs(11,0): at FsUnit.should[a,a](FSharpFunc`2 f, a x, Object y)
        C:\Users\Stephen\Documents\Visual Studio 2010\Projects\Unquote\VerifyNunitSupport\VerifyNunitSupport.fs(29,0): at Test.Swensen.Unquote.VerifyNunitSupport.test1()
    

    Whereas the failing Unquote assertion 1 <>! 1 produces the following failure message (notice the cleaner stack trace too)

    Test 'Test.Swensen.Unquote.VerifyNunitSupport.test1' failed: 
    
    1 <> 1
    false
    
        C:\Users\Stephen\Documents\Visual Studio 2010\Projects\Unquote\VerifyNunitSupport\VerifyNunitSupport.fs(29,0): at Test.Swensen.Unquote.VerifyNunitSupport.test1()
    

    And of course from my first example at the beginning of this answer, you can see just how rich and complex Unquote expressions and failure messages can get.

    Another major benefit of using plain F# expressions as test assertions over the FsUnit DSL, is that it fits very well with the F# process of developing unit tests. I think a lot of F# developers start by developing and testing code with the assistance of FSI. Hence, it is very easy to go from ad-hoc FSI tests to formal tests. In fact, in addition to special support for xUnit and NUnit (though any exception-based unit testing framework is supported as well), all Unquote operators work within FSI sessions too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a refactoring plugin which specifically has the ability to take
Are there any continuous integration frameworks for CL? Specifically, I'm looking for: Automated build,
Where can I download .NetFramework 4 SDK? Update I am looking specifically for the
Looking into org.pentaho.reporting.engine.classic.core.DataFactory and more specifically into the initialize method (which was formerly part
Specifically, I am looking for a pattern to provide components with information about the
Am curently looking at the jqgrid documentation on advanced search and specifically search_adv.php file
I'm looking for an example of parsing an FLV header for duration specifically in
More specifically, does NDK have a complete STL implementation. We're looking at this for
I am looking to upload a photo from iPhone to a 4D Server. Specifically
I'm looking at integrating an ESB into an existing Java/Maven web based product. Specifically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.