xunit / resharper-xunit

ReSharper runner for xUnit.net
Apache License 2.0
91 stars 20 forks source link

Annotations for xunit.extension and xunit.runner.utility? #47

Open citizenmatt opened 9 years ago

citizenmatt commented 9 years ago

Are these worthwhile?

edblackburn commented 8 years ago

Well. I am the first person to comment since April 10th, so I presume it's not a must have request(!)

I have just pulled the Sample repo and I'm struggling to them at all. My goal is to build an xunit extension that is backwards compatible with a subset of machine.specification tests. I'm only just spiking now but am struggling to even run the tests.

I suppose it depends on how much of an ecosystem forms around xunit.extensions. It's a chicken and egg situation. If it is difficult to run the tests, people won't leverage xunit.extension. If there's no extensions then there's no need for the runner?

If I can get any of the samples running at all perhaps I'd be more inclined to come back and offer some assistance.

BrunoJuchli commented 8 years ago

@edblackburn i'm trying to do quite the same :D It took me quite a while to get into it as well. Running xunit2 extensibility based tests in r# doesn't work (yet) b/c the resharper plugin does not use xunit2 discovery yet, also see #1

@citizenmatt what kind of annotations do you mean specifically? I'm not sure what you mean by the term. Do you you mean the code-inline xml doc on code elements? (like javadoc, they got a proper name for it ;-) )

edblackburn commented 8 years ago

@BrunoJuchli I see you have an email address on your profile. I will mail you next week to see if we can collaborate?

I use NCrunch as my primary test runner. Persuading people to build in xunit.extensions could be tricky. But if an OSS implementation can be built into R# then perhaps they'll be a defence point?

BrunoJuchli commented 8 years ago

@edblackburn yeah let's discuss it :)

citizenmatt commented 8 years ago

@BrunoJuchli I meant ReSharper's annotation attributes, that it uses to improve analysis and provide extra functionality. I'm already using it for Assert.False in xunit.assert.dll to mark it as an assertion method that throws an exception if you pass false in. ReSharper can use this to provide better analysis - e.g. if it knows or works out that you're passing false in, it can grey out following code. You can also add annotations such as telling ReSharper that a string parameter should be treated as a regular expression.

It might be worth adding some annotations for unit.extension.dll and xunit.runner.utility.dll. I'm not sure what though - null/not-null annotations probably, or base types required, interfaces required, etc. Haven't really looked. It's not going to provide a huge amount of help when writing extensions or runners, but it might be useful.