Comments (14)
Yes, we need FAKE
support of NUnit3
first
fsprojects/FAKE#1010
from fsunit.
So, probably it is time to try to support of NUnit 3 fsprojects/FAKE#1064
from fsunit.
@et1975 do you have experience of writing custom constrains for NUnit3
?
from fsunit.
I wanted to take a look at v3 anyways, might as well port this.
from fsunit.
Thank you @et1975
from fsunit.
Once nunit/nunit#1196 is resolved the changes in et1975/FsUnit/equals branch should do it.
from fsunit.
The NUnit team is working on custom message formatters based on the issue nunit/nunit#1196 and original PR by @et1975. @CharliePoole has create PR nunit/nunit#1222
This fix is intended for you, so we would appreciate a code review to see if it meets your needs.
Once it is merged, if you need to test using the NuGet packages produced by our continuous build, I can point you to them.
@sergey-tihon what do you need custom constraints for? They are fairly easy to write. If you need help, please reach out.
from fsunit.
Here's another question about our (NUnit's) support for F#.
Can anybody think of a way to add a feature to the NUnit framework, so that it is only accessible to F#. Resolving nunit/nunit#1196 with a static global is cool for F# users, who will access it in a top-level module, rather than from a test. It's a bit more dangerous in C# (not to mention VB) where calling it from within a test is the most natural way to do it. Adding a new formatter inside a test using the a static method creates a nasty side-effect.
Maybe we need a separate module per language on top of the framework, but that's a very busy solution. Which is what leads to the question: how to give something to F# users without giving it to other users?
from fsunit.
@rprouse
Would be nice to test in once it is merged. Appreciate if you point me to you nightly packages.
There are only two custom constrains in current codebase:
- EqualsConstraint - we use it to pretty-print F# values
- ChoiceConstraint which allow us to write constrains for F# Core.Choice<'T1,'T2> values, like
Choice<int, string>.Choice1Of2(42) |> should be (choice 1)
@CharliePoole I think that the reason why @et1975 did not want to do it in OneTimeSetUp
is that we can do it once per assembly with static method.
Users of FsUnit
can get it for free because it will be in FsUnit.dll
and that is enough.
from fsunit.
@sergey-tihon It sounds like F# users are likely to be satisfied by this. My concern is that we are exposing the feature to all users and those working in other languages who use this in the most "obvious" way will be unexpectedly impacting global state. That is, such users are likely to call the method in a setup or onetimesetup. They will expect the custom format to go away when the scope of the setup terminates but that won't happen.
In fact F# users could fall into the same trap but probably won't because they have an easier way to use the feature.
I'll keep playing with this and let you know when there is something relatively final to test.
from fsunit.
@sergey-tihon the NuGet feed is at https://ci.appveyor.com/nuget/nunit
Currently you need to figure out which build a fix is in by looking at the AppVeyor builds and getting the build number. Less than ideal. We plan to fix it, but haven't yet. Remind me once the PR is merged and I will get you a package version that will work for you.
I assume that the custom formatter will solve your need for the EqualsConstraint and open up more of our constraints for your use. Looking at ChoiceConstraint, it looks like it should just work, although my F# foo is not strong 😄
from fsunit.
@sergey-tihon if you wanted to test with the NuGet package of the current PR, the latest version is 3.1.0-CI-2072
from fsunit.
@sergey-tihon Note however that the current PR is marked Do Not Merge because it is still in development. The calling sequence could change.
from fsunit.
Support of NUnit 3 released in FsUnit 2.0.0
Let's tack support of NUnit v3.2 in separate issue - #86
from fsunit.
Related Issues (20)
- ofCase doesn't support generic union type HOT 2
- ofCase doesn't handle None (represented as null) HOT 3
- equalWithin on DU types of float HOT 6
- Implementing Expecto HOT 6
- `result |> should be (ofCase <@ Ok @>)` throws exception at runtime HOT 3
- Error message when DateTime is not equal does not provide any help HOT 4
- Error message for "equal" is difficult to read and does not show the date milliseconds also when that is the only difference
- Method not found: 'Void Xunit.Sdk.AssertActualExpectedException..ctor HOT 2
- Pipelines are not correctly failing HOT 3
- Inconsistent behaviour of `should equal` in NUnit vs XUnit HOT 1
- Update docs site HOT 7
- error FS0074: The type referenced through 'NHamcrest.IMatcher`1' is defined in an assembly that is not referenced. HOT 2
- Using `should throw` does not show the raised exception, only the string version of the lambda HOT 5
- [Feature request] Creating custom constraints HOT 4
- Using 'should throw' or 'should throwWithMessage' never succeeds unless function returns unit HOT 15
- Deep equality for C# types HOT 5
- Comparing sequences fails HOT 13
- New Year's ToDos HOT 1
- Is FSharp.Core 6.0.7 really the lowest dependency for FsUnit? HOT 3
- `MatchException` does not exist anymore in 2.5.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsunit.