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
Where is xUnit API reference / in detail documentation? (it is question, not Issue) #1018
Comments
Unfortunately, it looks like there is no official API nor official documentation apart from what you can find on main page. |
+1 |
There is a documentation site: https://xunit.github.io/ However, there is no API documentation there. We ship the XML documentation in the ZIP file for Intellisense, but thus far have not worked on a system to automatically generate HTML from that XML. |
Not even a quickstart describing the concurrency, or setup/teardown semantics! Worst. documentation. ever. |
@Neutrino-Sunset Thank you for the constructive feedback. FYI, both topics are already documented: If you have any improvements to offer, we accept pull requests. |
Appreciate this project pushes good code styles over stale documentation. That being said, it would lower the bar to entry to have "the basics" documented in the documentation area of https://xunit.github.io. If I get some time soon, will send a PR. |
@bradwilson I'd recommend using monodoc to turn the xml doc file into something browsable. |
For whoever has mono and therefore the
Open the |
Closed for age. |
their tests may help understand/find the needed info. accuracy guaranteed |
I think closing the issue is not the right solution but working on the problem. The xUnit documentation is really poor, and taking into account that this is the most used .NET testing framework it shouldn't be that way! If we look at PHPUnit documentation for example, we find a lot of useful information, even a detailed list of every assertion available! |
@maxalmonte14 In addition to being closed for age, it should also have been closed as being non-actionable. Issues need to be opened for specific, discrete bugs or tasks. "Please make X better" is too open ended to be usable. As mentioned above, we welcome specific issues as well as PRs to improve the documentation (the docs site is on Github as well). |
Not to sound too snarky here, but I think what we're all asking for is documentation that reveals the answer to the following fundamental question:
Such a document goes by many names: API Reference, Class Reference, or most libraries just call it "the docs", or the proverbial object of many an "RTFM" response. Examples: I'm trying to learn about Xunit and to understand what In the meantime, for others who find themselves here as the top Google search result for "Xunit API Reference", your best bet is to read through the Xunit source code itself. For convenience, here's what I think may be the implementation for
|
The API documentation is contained in the XML doc comments (which ship with the library). They are surfaced via Intellisense. Since this is not a convenient form for browsing, there is an open issue to get the API documentation added to the web site: #1902 |
Very disappointed to discover XUnit assertion docs are non-existent. All it takes is a brief one line per method to improve the situation. Tempts me to port my old NUnit wrapper over to XUnit to fix this. See how easy it is ... |
Sounds like it should be very easy for you to get over your disappointment by contributing that which you seek. I'm not sure how wrapping solves any problems. |
https://fluentassertions.com/ solves my problem. This solves the problem by wrapping the xUnit assertion API with BDD assertions that are fully documented and much nicer to use. |
Any API promoting 10 deep dotted method chaining and classes with properties called 'And' needs burning. What kind of OOP is that supposed to be? If a result is expected to meet multiple expectations, the most readable expression of that is to have multiple statements. Jamming a dozen expressions into a single statement glued together with 'And' properties is horrible and unnecessary. |
As long as this nonsense doesn't make it into the core library and turn it from something with xmldoc into something needing a Friendly Manual or a 20 page README.me, it's all good ;) Some day, it'll all collapse to something like this. |
We accept PRs for https://github.com/xunit/xunit.github.io |
It's absolutely actionable: write better documentation.
Which is useless without samples and explanation. Have a look at the Android documentation. That too is just JavaDoc documentation inside the code. But it has examples, pictures, explanations. The Android documentation is useful. |
The Android documentation has the backing of a large number of full time devs and tech writers. xUnit has a good community, but nobody has a day job that's remotely connected to being responsible for write better documentation which they should be held accountable for. and 🔥 I bet they have a 1% less entitled user community that will 2% more frequently bring the change they seek To be clear: I'd also love to to have clear and complete documentation. But I won't be registering my strong dissatisfaction that it's not there until I demonstrate with pull requests and actual real contributions that I'm not just someone that wishes to register a complaint about the current state of the world. |
@krischick I will refer you to the post immediately above yours: we accept PRs. |
Was pretty excited about xUnit to try since this stackoverflow answer gave some good points, yet now discovering that xUnit doesn't even tell you how to do simple things is just... sad for more then 3 years already! By now again looking at the documentation provided by NUnit, I'm immediately sold for their rich documentation. |
@Ruud-cb you can be the change you wish to see and be a part of making these things happen. While the feedback is not entirely useless, it adds up to kicking sand in faces and running off in the end from where I'm sitting. Ultimately the maintainers + (generally very limited) community around a project have hard choices to make in terms of how to balance the use of their time on open source projects (remember, this stuff does not pay bills - its a labour of love and a gift). As a 11 year+ user of xUnit, I deeply appreciate Brad's (and Jim, but really Brad :D) demonstrated commitment to making the hard choices of how to best invest their finite time, and the courage to say no to doing anything half-assed (i.e. saying no to adding some features, not straying into providing guidance on subjective matters around testing). |
I went to the GitHub site referenced above and it says the repo has been archived and is read-only. Does that mean PR's are not still accepted? I'm also needing documentation but am willing to contribute as time allows, if I can. |
No official API doc? Seriously? I'm trying to get into TDD with C#, which is one of the most frustrating endeavors I've ever tried. |
Checkout https://fluentassertions.com/ that wrappers xUnit. Nice docs. |
I'm just going to answer this for future googlers: There is no online documentation but there are documentation comments in the source code of xUnit itself. You can see it by either:
This may be obvious to some people but It needs to be pointed out in this thread. |
As a brand-new programmer and user to xUnit, I don't have the experience or knowledge necessary to contribute anything yet, in large part because I cannot find any kind of documentation that could help get me to a place where I could make a contribution. Having to install Yet Another Thing I Don't Understand (fluent assertions) just to make the Thing I Barely Understand somewhat usable is an incredibly daunting prospect for the newbie. I just want to know why Assert.IsType(player) doesn't return true when I've literally just instantiated a Player object. Is this a Moq problem? I don't know, it's Yet Another Thing I Barely Understand that I've installed in the hopes that this stuff will Just Work one day. If you want more contributions, it needs to be possible for new people to get spun up enough to contribute anything. |
re @NilsFantastic ☝️☝️
I would add
Taking a stab:
If it cannot be downcast, it will have thrown already. It's possible that you are testing the edited to add: See Brad's post below - I confused While some people watch this repo, the bottom line is that the Issues are for confirmed problems that are going to be solved in some clear way. Figuring out how to use it etc is best done either in the Discussions, or on Stackoverflow.com - there are way more people there. In both cases, it would be helpful to show what you are doing so people can get you unstuck quickly without having to guess what you are doing and what you've tried. (I only saw this because I was involved earlier in the thread) And you absolutely don't need Fluent Assertions. The built in ones are not fluent. You can argue that some things are missing, but in general that's by design - the intentional lack of corner case features in xUnit.net is absolutely a feature. (Fluent assertions and the like obviously have plenty followers, and plenty positives; just flagging the fact that many people intentionally use the built in If you feel the desire to discuss and/or anyone else feels the desire to rant, please don't do it on this thread - create a Discussion or post on SO please |
Wow, thank you! That was incredibly clear and helpful. I only posted here to show support for the idea that this documentation is sorely needed, with my minor issue as an example. I wasn't expecting to receive actual help. I genuinely appreciate it. |
Not a problem - there's a heck of a lot of people that appreciate and use xUnit, and they do like to help where they can. Plenty people like me monitor the .NET OSS being the way it is, sadly quality beginner to intermediate level docs don't just happen to the degree that they do in some other ecosystems. (NUnit and MSTest definitely have better docs, but they've also had more people working on them over time. Doesn't make me recommend them instead though!) |
The answer is both "yes" and "no". 😁 The Intellisense for So this assertion is checking for exact type, not compatible type; the latter is handled by So why is this a Moq "problem"? Off the top of my head, there a couple ways it could go sideways:
If this is the case, as @bartelink notes above, calling
There is a project site at https://xunit.net/ with some documentation, but it currently does not contain the documentation that you see with Intellisense (that's only available in a compatible editor like Visual Studio or VS Code). There is an open issue for this: #1902 |
Leaving my 2 cents here: yes, I can read the source code, and I am sometimes forced to do so. It's not convenient though, and I like to avoid doing this when I can. Adding documentation is what I would call very low-hanging fruit: a little would go a very long way. Here's the main reason: sure, if I want to know how something works, I'll go read the source code. Question is, how do I figure out what is available and how to do things? Read through the entire source code? That is an utterly undefendable position. Who should add the doc and whether doc should be added are also two very different issues: the dev team's position is rather confusing with respect to these two issues. |
@davidcian As ever, we would gladly accept PRs to address this. |
Hello,
I like xUnit, but i can't find good documentation for it.
Where is API reference or detailed documentation for your library?
The text was updated successfully, but these errors were encountered: