Skip to content
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

Added FsUnitTyped module + tests #85

Merged
merged 7 commits into from
Mar 7, 2016

Conversation

sergey-tihon
Copy link
Member

Added typed version of FsUnit (created by @forki) as separate FsUnitTyped module.

Who want to see it packed in FsUnit distrib?
// cc: @forki

  • Discuss publicly that this feature is requiried
  • Add documentation to FsUnitTyped
  • Check what open issues can fixed in FsUnitTyped by design and add appropriate unit tests

@sergey-tihon sergey-tihon changed the title Added FsUnit.Typed module + tests [WIP] Added FsUnit.Typed module + tests Feb 2, 2016
@tpetricek
Copy link
Member

Yes yes yes yes yes yes please yesss!!!

[Unrelated rambling]
I would love it if you could also reference FsUnit just as a single file using the neat Paket file dependencies. This would avoid a bit of pain with configuring binding redirects and there really is no need for having to get a whole nuget package for this.
[/Unrelated rambling]

@sergey-tihon
Copy link
Member Author

@tpetricek you already can reference FsUnit.fs as single file
http://fsprojects.github.io/FsUnit/Paket.html

the same true for FsUnit.Typed.fs after merging this PR

@tpetricek
Copy link
Member

Woohoo!

@CraigStuntz
Copy link

First, I'm really happy to see this change!

Second, although using strong typed references does make things much better, it would be great to avoid Assert.AreEqual altogether, because the implementation looks like this. I've opened an issue on NUnit about fixing that, but it may take a long time to implement.

@sergey-tihon
Copy link
Member Author

@CraigStuntz So, you prefer something like this:

    [<DebuggerStepThrough>]
    let shouldEqual (expected : 'a) (actual : 'a) = 
        Assert.True((expected = actual), sprintf "Expected: %A\nActual: %A" expected actual)

instead of Assert.AreEqual?

@CraigStuntz
Copy link

@sergey-tihon I think I do, but I'm wondering if anyone uses FsUnit to test C# code? If so, not sure if Assert.True(expect.Equals(actual), ... would be better? Almost anything seems better than going into the Assert.AreEqual code, though.

@sergey-tihon
Copy link
Member Author

@CraigStuntz We can assume that nobody use FsUnit from C#.
At least I do not see any sense to do it.

We need to chose better way from F# perspective

@sergey-tihon sergey-tihon changed the title [WIP] Added FsUnit.Typed module + tests Added FsUnit.Typed module + tests Mar 7, 2016
@sergey-tihon sergey-tihon changed the title Added FsUnit.Typed module + tests Added FsUnitTyped module + tests Mar 7, 2016
@sergey-tihon sergey-tihon added this to the Typed FsUnit milestone Mar 7, 2016
sergey-tihon added a commit that referenced this pull request Mar 7, 2016
Added FsUnitTyped module + tests
@sergey-tihon sergey-tihon merged commit ddf3912 into fsprojects:master Mar 7, 2016
@sergey-tihon sergey-tihon deleted the typed branch March 7, 2016 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants