NUnit / VS Integration

6 views
Skip to first unread message

Charlie Poole

unread,
Dec 13, 2009, 3:50:45 PM12/13/09
to nunit-...@googlegroups.com
Hi All,

Following up on Steve's recent post, I'd like to invite comments on
how we should be interacting with VS. You can assume that any such
interaction or integration will be in an extension that is separate
from the basic functionality, so it won't impinge on folks using
NUnit - as one example - on Linux.

Also, bear in mind that we are talking about interaction using the
standard NUnit runners. A future VS addin is probably in the cards
and would do a lot more.


What we Currently Do...

1. Open VS projects and solutions

2. Send output to VS when running under debugger

What's currenly requested...

3. Make console output work with VS when nunit is launched as
the debug application or in a post-build event.

What else do we need?

Charlie



Simone Busoli

unread,
Dec 14, 2009, 3:42:44 PM12/14/09
to nunit-...@googlegroups.com
Something which works OOTB like TD.Net?




--

You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To post to this group, send email to nunit-...@googlegroups.com.
To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.



Yann

unread,
Dec 14, 2009, 4:25:23 PM12/14/09
to nunit-...@googlegroups.com
I second that!

Jamie Cansdale

unread,
Dec 14, 2009, 5:11:48 PM12/14/09
to nunit-...@googlegroups.com
> Also, bear in mind that we are talking about interaction using the
> standard NUnit runners. A future VS addin is probably in the cards
> and would do a lot more.
>
I'd like to see an official NUnit project template. You could tweak
the project file so that hitting F5 runs the project with the NUnit
console (see below). This dovetails nicely with sending output to VS
when running under debugger. In theory these projects should also work
under MonoDevelop.

<PropertyGroup>
<StartAction>Program</StartAction>
<StartArguments>$(TargetFileName)</StartArguments>
<StartProgram>$(MSBuildProjectDirectory)\NUnit\bin\nunit-console.exe</StartProgram>
</PropertyGroup>

This has the advantage that it works with the Express versions of VS
(for people who don't have access to the full version of VS and
extensions like TD.Net). BTW, I've confirmed with Microsoft that they
don't have a problem with this. ;-)

Regards,
Jamie.

--
http://www.testdriven.net
http://twitter.com/jcansdale
http://weblogs.asp.net/nunitaddin

Simone Busoli

unread,
Dec 14, 2009, 5:26:19 PM12/14/09
to nunit-...@googlegroups.com
That wouldn't be very difficult to set up, but looks more like a hack to me than a real integration of NUnit within VS.

Charlie Poole

unread,
Dec 14, 2009, 5:44:31 PM12/14/09
to nunit-...@googlegroups.com
Hi Jamie,

Nice idea. I especially like the part where I'd never have to
explain to anyone how to set this up again. :-)

Charlie

> -----Original Message-----
> From: nunit-...@googlegroups.com
> [mailto:nunit-...@googlegroups.com] On Behalf Of Jamie Cansdale
> Sent: Monday, December 14, 2009 2:12 PM
> To: nunit-...@googlegroups.com
> Subject: Re: [nunit-discuss] NUnit / VS Integration
>

Charlie Poole

unread,
Dec 14, 2009, 5:45:54 PM12/14/09
to nunit-...@googlegroups.com
Sure, but real integration == addin (or package) and I was asking about ideas that
are short of that - IOW for hacks. :-)
 
Charlie


From: nunit-...@googlegroups.com [mailto:nunit-...@googlegroups.com] On Behalf Of Simone Busoli
Sent: Monday, December 14, 2009 2:26 PM

To: nunit-...@googlegroups.com
Subject: Re: [nunit-discuss] NUnit / VS Integration

Charlie Poole

unread,
Dec 14, 2009, 5:48:07 PM12/14/09
to nunit-...@googlegroups.com
Yup, that would be the "future VS addin" I was talking about. I'm thinking
of that as dessert. I feel obligated to eat my vegetables by getting out new
console and gui runners first. :-)
 
Charlie


From: nunit-...@googlegroups.com [mailto:nunit-...@googlegroups.com] On Behalf Of Simone Busoli
Sent: Monday, December 14, 2009 12:43 PM

To: nunit-...@googlegroups.com
Subject: Re: [nunit-discuss] NUnit / VS Integration

Kenneth Xu

unread,
Dec 16, 2009, 8:09:22 PM12/16/09
to nunit-...@googlegroups.com
Me too!

Charlie Poole

unread,
Dec 16, 2009, 8:21:58 PM12/16/09
to nunit-...@googlegroups.com
So is the message that we should stop fooling around with half
measures? :-)

Charlie

> -----Original Message-----
> From: nunit-...@googlegroups.com
> [mailto:nunit-...@googlegroups.com] On Behalf Of Kenneth Xu
> Sent: Wednesday, December 16, 2009 5:09 PM
> To: nunit-...@googlegroups.com
> Subject: Re: [nunit-discuss] NUnit / VS Integration
>
> Me too!
>
> On Mon, Dec 14, 2009 at 4:25 PM, Yann <yann...@gmail.com> wrote:
> > I second that!
> >
> > From: Simone Busoli
> > Sent: Tuesday, December 15, 2009 7:42 AM
> > To: nunit-...@googlegroups.com
> > Subject: Re: [nunit-discuss] NUnit / VS Integration
> >
> > Something which works OOTB like TD.Net?
> >
>

Kenneth Xu

unread,
Dec 16, 2009, 11:19:24 PM12/16/09
to nunit-...@googlegroups.com
For somebody really doing TDD, 99% of times he needs to run a specific
test or test fixture instead of full project.

I dream for ReSharper type of integration but I understand the
difficulty as it needs source code level analysis. So TD.Net kind of
integration is more realistic and also sufficient for day to day TDD
work.

Cheers,
Kenneth

Jamie Cansdale

unread,
Dec 17, 2009, 5:49:26 AM12/17/09
to nunit-...@googlegroups.com
If you're interested in TestDriven.Net like integration, I'm curious
to know why you don't just use TestDriven.Net Personal. Is there
something in the Personal license that you don't like, or is something
else missing? I do try to work closely with the NUnit team and keep up
with new releases. Would knowing you could use it on commercial
projects make a difference?

Regards,
Jamie.

Adam Connelly

unread,
Dec 17, 2009, 8:20:29 AM12/17/09
to nunit-...@googlegroups.com
I would love to have ReSharper type integration with Visual Studio, but like Kenneth I imagine it's probably too much to ask for at the moment. My view is that, if possible, users should be able to download a single installer for NUnit that would give them the Console, GUI and Visual Studio integration. I say this for completely selfish reasons: I use ReSharper in work, but I couldn't really justify buying it for home use. :P

One of my colleagues describes ReSharper as programmers' crack - so true.

Adam

2009/12/17 Jamie Cansdale <jcan...@gmail.com>

Simone Busoli

unread,
Dec 17, 2009, 3:10:41 PM12/17/09
to nunit-...@googlegroups.com
I myself use TD.Net personal at home as well as the enterprise version at work. I couldn't ask for anything better but direct support for that in NUnit. But that's actually not a big deal, and one of the biggest advantages of having a VS plugin distributed with NUnit is that you wouldn't have to care about which version of either you are using and whether they're compatible. But since TD.Net introduced support for running tests using a specific version of the testing framework assemblies this is no longer an important one.

André Nogueira

unread,
Dec 17, 2009, 6:11:07 PM12/17/09
to nunit-...@googlegroups.com
Hi Jamie,

$170 is a very low price for the value, but it all depends on who's paying. If it's a company, it's extremely cheap. If it's the developer him/herself, things are quite different.

In my case, I never installed it - even though I do think it's extremely useful. My contribution to .Net open-source projects has never been big enough to justify applying for a Personal license, and being a student who had only small development jobs I couldn't afford the professional license. If I had applied for the Personal license (even for Academic projects) I know I'd end up greatly abusing it and using in my jobs, so to avoid that I simply never installed it. 

In short, it's not about the value - it's about being able to pay the price :)

- André

Kenneth Xu

unread,
Dec 17, 2009, 6:15:44 PM12/17/09
to nunit-...@googlegroups.com
Hi Jamie,

I do use TD.Net Personal for my open source projects. What especially
useful to me are the test with coverage option and adhoc execution of
any method. And thank you again for making a great product free to
open source community.

Yes, the commercial projects is the issue. We already purchased
ReSharper, a great tool! It has otherwise wonderful NUnit integration
except that it cannot keep up with the NUnit releases (hopefully this
will change in future). I cannot justify to buy TD.Net just for unit
testing at the price level that is close to ReSharper C# Edition.

On the other hand, if NUnit is to compete with MS's test framework, I
think better out of box support is necessary.

Cheers,
Kenneth

Yann

unread,
Dec 17, 2009, 11:39:05 PM12/17/09
to nunit-...@googlegroups.com
Hi,

Could somebody give me the syntax in VB for Throws.Exception? Does VB syntax
exist somewhere on the Nunit site? Everything always seems to only be in C#.

I've tried feeding the example found on http://nunit.com/blogs/?p=63 to
Instant VB, but even with the "&gt" corrected to a ">" it doesn't seem to
translate properly.

Thanks,

Yann

--------------------------------------------------
From: "Jamie Cansdale" <jcan...@gmail.com>
Sent: Thursday, December 17, 2009 9:49 PM


To: <nunit-...@googlegroups.com>
Subject: Re: [nunit-discuss] NUnit / VS Integration

> If you're interested in TestDriven.Net like integration, I'm curious

Yann

unread,
Dec 18, 2009, 12:31:20 AM12/18/09
to nunit-...@googlegroups.com
Hi Jamie,

I LOVE the personal version of TestDriven.net! It's a *brilliant* program.

But I'm a sole developer who just can't justify paying for a version to use
in the one project I'm currently working on. My project isn't open source,
but I'm not currently making any money from the project yet. If I was I'd
certainly buy a commercial license.

Having ad-hoc testing, & the ability to right-click a project/class & run
the tests, built into NUnit, like TD.NET has would be awesome. Not only the
cost issue, but also only having to have ONE program to install & keep
updated.

Alternatively, being able to use the personal version for small-ish non-open
source projects, as you *seem* to be suggesting might be a possibility,
would also be an alternative solution.

That's *my* 2c..

Yann

--------------------------------------------------
From: "Jamie Cansdale" <jcan...@gmail.com>

Sent: Thursday, December 17, 2009 9:49 PM


To: <nunit-...@googlegroups.com>
Subject: Re: [nunit-discuss] NUnit / VS Integration

> If you're interested in TestDriven.Net like integration, I'm curious

Charlie Poole

unread,
Dec 18, 2009, 2:41:25 AM12/18/09
to nunit-...@googlegroups.com
Hi Yann,

> Could somebody give me the syntax in VB for Throws.Exception?
> Does VB syntax exist somewhere on the Nunit site? Everything
> always seems to only be in C#.

The best example in the NUnit distribution for VB is probably
AssertSyntaxTests.vb in the VB samples directory. However, it
has not been updated to have an example of Throws.Exception.

Mainly, you can use the C# example, plugging in the syntax
for a VB delegate as the first argument. Does somebody else
here have a good example?

Charlie

Charlie Poole

unread,
Dec 18, 2009, 2:50:07 AM12/18/09
to nunit-...@googlegroups.com
Hi Kenneth (and Jamie),

> Yes, the commercial projects is the issue. We already
> purchased ReSharper, a great tool! It has otherwise wonderful
> NUnit integration except that it cannot keep up with the
> NUnit releases (hopefully this will change in future). I
> cannot justify to buy TD.Net just for unit testing at the
> price level that is close to ReSharper C# Edition.

Just for the record, Resharper doesn't have NUnit integration,
it has integrated NUnit emulation. :-)

I had an experience with one client, where I suggested they
purchase Resharper for refactoring and TD.Net for running
tests. In spite of the low price (I think it was around
$90 at the time) they decided they "couldn't afford"
TD.Net. This even though they were paying MS umpteen
dollars a year for a subscription and buying Resharper
and lots of other stuff - not to mention paying big
money out every month for developer time. It's a foolish
way to behave but seems to be common.

> On the other hand, if NUnit is to compete with MS's test
> framework, I think better out of box support is necessary.

Sadly, that's the case. Although I'm very interested in
MonoDevelop as an alternative to the whole thing now that
it works on Windows. They still have some NUnit versioning
issues but I think we can help them overcome those
problems with NUnit 3.0.

Charlie

> Cheers,
> Kenneth
>
> On Thu, Dec 17, 2009 at 5:49 AM, Jamie Cansdale
> <jcan...@gmail.com> wrote:
> > If you're interested in TestDriven.Net like integration,
> I'm curious
> > to know why you don't just use TestDriven.Net Personal. Is there
> > something in the Personal license that you don't like, or
> is something
> > else missing? I do try to work closely with the NUnit team
> and keep up
> > with new releases. Would knowing you could use it on commercial
> > projects make a difference?
> >
> > Regards,
> > Jamie.
> >
> > --
> > http://www.testdriven.net
> > http://twitter.com/jcansdale
> > http://weblogs.asp.net/nunitaddin
>

Jamie Cansdale

unread,
Dec 18, 2009, 6:10:45 AM12/18/09
to nunit-...@googlegroups.com
Simone, André & Yann,

Here's the deal with the TestDriven.Net Personal licence; You are free
to download and use it for as long as you like. If after using it for
a while you can justify a purchase, that's great! However, there's
noting in the license that prevents you from using it on commercial
projects.

I know there are companies where it's a struggle to purchase software
beyond an MSDN subscription. As far as I'm concerned, developers
working in this kind of environment are being penalized enough and I'm
certainly not going to stop them from using TestDriven.Net!

> Alternatively, being able to use the personal version for small-ish non-open
> source projects, as you *seem* to be suggesting might be a possibility,
> would also be an alternative solution.
>

If you can't justify paying for it, I don't expect you to. You are
free to install it and stop worrying. :-)

Regards,
Jamie.

Yann

unread,
Dec 18, 2009, 7:28:12 AM12/18/09
to nunit-...@googlegroups.com
Jamie,

You're an absolute legend!

And I can assure you that when I get to the point where I *can* afford to
pay for a license I *will* be doing so, & doing so happily.

Thank you!

Yann

--------------------------------------------------
From: "Jamie Cansdale" <jcan...@gmail.com>

Sent: Friday, December 18, 2009 10:10 PM


To: <nunit-...@googlegroups.com>
Subject: Re: [nunit-discuss] NUnit / VS Integration

> Simone, Andr� & Yann,

André Nogueira

unread,
Dec 18, 2009, 8:01:59 AM12/18/09
to nunit-...@googlegroups.com
Hi Jamie,

Thank you for the clarification!

I just double checked the site, and the download page says the Personal
Version is "for students, open source developers and trial users" while
the Professional Version is "for individual developers" (with the
"commercial" being implied, at least for me). If you click on the
License Terms link it says explicitly that the Personal License " is not
intended for use within a commercial environment, except for evaluation
purposes" .

I then double checked the PDF license too and read it more carefully -
while it does not explicitly forbid commercial usage, it doesn't allow
it explicitly either. But then again, neither does the Professional
license :)

It was all this put together that made me believe that commercial use of
the Personal Version was not allowed. But it's good to know that is not
the case - it certainly is an immensely useful tool, and could have
saved me a large amount of time in the past!

Thanks,
- Andre

Jamie Cansdale wrote:
> Simone, Andr� & Yann,

Jamie Cansdale

unread,
Dec 18, 2009, 10:13:05 AM12/18/09
to nunit-...@googlegroups.com
> I then double checked the PDF license too and read it more carefully  -
> while it does not explicitly forbid commercial usage, it doesn't allow
> it explicitly either. But then again, neither does the Professional
> license :)
>
My solicitor thought I was crazy for not wanting to put any commercial
usage restrictions in the license. I do need to earn a living somehow,
but I'd also rather people use TestDriven.Net than not if they can't
justify the cost.

> It was all this put together that made me believe that commercial use of
> the Personal Version was not allowed. But it's good to know that is not
> the case - it certainly is an immensely useful tool, and could have
> saved me a large amount of time in the past!
>

It's a tricky balancing act. I've ended up saying who the *intended*
users are, rather than making it explicit that the personal version is
fully functional and there are no usage restrictions. I've
deliberately avoided nag dialogs, license keys or anything else that
would compromise the user experience once downloaded.

Regards,
Jamie.

2009/12/18 André Nogueira <andre.n...@gmail.com>:


> Hi Jamie,
>
> Thank you for the clarification!
>
> I just double checked the site, and the download page says the Personal
> Version is "for students, open source developers and trial users" while
> the Professional Version is "for individual developers" (with the
> "commercial" being implied, at least for me). If you click on the
> License Terms link it says explicitly that the Personal License " is not
> intended for use within a commercial environment, except for evaluation
> purposes" .
>
> I then double checked the PDF license too and read it more carefully  -
> while it does not explicitly forbid commercial usage, it doesn't allow
> it explicitly either. But then again, neither does the Professional
> license :)
>
> It was all this put together that made me believe that commercial use of
> the Personal Version was not allowed. But it's good to know that is not
> the case - it certainly is an immensely useful tool, and could have
> saved me a large amount of time in the past!
>
> Thanks,
> - Andre
>
> Jamie Cansdale wrote:

>> Simone, André & Yann,

Kenneth Xu

unread,
Dec 18, 2009, 4:29:48 PM12/18/09
to nunit-...@googlegroups.com
Hi Charlie,

> Just for the record, Resharper doesn't have NUnit integration,
> it has integrated NUnit emulation. :-)

Thanks for the clarification and yes I understood and hoping this will change :)

> I had an experience with one client, where I suggested they
> purchase Resharper for refactoring and TD.Net for running
> tests. In spite of the low price (I think it was around
> $90 at the time) they decided they "couldn't afford"
> TD.Net. This even though they were paying MS umpteen
> dollars a year for a subscription and buying Resharper
> and lots of other stuff - not to mention paying big
> money out every month for developer time. It's a foolish
> way to behave but seems to be common.

Well, here is the typical story:

D (developer) : Can we buy TD.Net?
B (the budget keeper): What is this for?
D: Mainly to help you easily and quickly run the test from VS so
developers can be more productive.
B : I remember that you told me ReSharper has the same feature.
D : Yes, but it doesn't support NUnit 2.5, and TD.Net doesn't a bit
more than that ...
B : How much does it cost?
D : $210
B : We just bought ReSharper for $250, I think we should stick with
NUnit 2.4 until ReSharper supports 2.5.
D : ...

I think MSDN subscriptions are typically covered by some other budget,
not under project budget. Yeah, it's silly but that's how it is. :(

Kenneth

Jeff Brown

unread,
Dec 18, 2009, 4:40:57 PM12/18/09
to nunit-...@googlegroups.com
We started using TDNet when it was free.  I probably shouldn't admit this, but when it went commercial, we continued using it under the Personal License...

Earlier this year I made a push to get us back into license compliance. Since we'd been using TDNet for years and it had become essential to our work, it was very easy to convince the powers that be to buy Professional Licenses for the team.  :-)

Jeff.

Sébastien Lorion

unread,
Dec 23, 2009, 1:34:26 PM12/23/09
to nunit-...@googlegroups.com
VB.NET (before .NET 4.0) does not support anonymous methods, so you will need to create a new Sub and point to it:

*warning: compiled with powerful gmail ide

Public Sub SomeTest()
Begin
  Assert.That(AddressOf MyMethod, _
    Throws.Exception(Of ArgumentException)(), _
    Has.Property("ParamName").EqualTo("myParam") _
    AndAlso Has.Property("Message").EqualTo("My message"))
End

Public Sub MyMethod()
Begin
  MethodUnderTest(anInvalidObject)
End

Sébastien 

Yann

unread,
Dec 23, 2009, 1:40:27 PM12/23/09
to nunit-...@googlegroups.com
Merci Sébastien!

Charlie Poole

unread,
Dec 23, 2009, 3:10:51 PM12/23/09
to nunit-...@googlegroups.com
Hi Sebastien,
 
Hey, we could use somebody to look after our VB examples and make sure our syntax
works for VB. Are you up for it?
 
Charlie


From: nunit-...@googlegroups.com [mailto:nunit-...@googlegroups.com] On Behalf Of Sébastien Lorion
Sent: Wednesday, December 23, 2009 10:34 AM
To: nunit-...@googlegroups.com
Subject: Re: [nunit-discuss] Throws.Exception VB Syntax

Sébastien Lorion

unread,
Dec 28, 2009, 6:38:14 PM12/28/09
to nunit-...@googlegroups.com
Hi Charlie,

Sure why not, with the caveat that I am not an expert in VB.NET, nor is it my career goal if you get my drift ;) Just point me to the right places and I will take a look.

Sébastien

Sébastien Lorion

unread,
Jan 5, 2010, 8:11:30 PM1/5/10
to nunit-...@googlegroups.com
Hi Charlie, just remembering you that I will gladly help with VB stuff
if you still need it. Maybe (sorry if I'm guessing wrong) you took my
slight against VB as saying I don't really want to help too much.
That's not the case, I just want to stay far from it in my
professional life. I think VB6 had some purpose, but in my eyes,
VB.NET mostly lost sight of it.

Happy New Year btw :)

Sébastien

Charlie Poole

unread,
Jan 6, 2010, 2:19:41 AM1/6/10
to nunit-...@googlegroups.com
Hi Sébastien,

Sorry not to get right back to you. I was wanting to first take a
look at the state of our VB-related stuff and other things have
interfered. I'd be glad to have you do it, and I'll get back with
details soon.

Happy new year to you too.

Charlie

Reply all
Reply to author
Forward
0 new messages