nunit / nunit-vs-testgenerator

A Visual Studio extension for generating unit tests and IntelliTests using NUnit
https://visualstudiogallery.msdn.microsoft.com/bd30bf3f-4183-4b00-a245-1875316b8cd3
MIT License
35 stars 23 forks source link

Issue 6 #7

Closed OsirisTerje closed 8 years ago

OsirisTerje commented 8 years ago

Fixed #6. Ready to be merged into master.

rprouse commented 8 years ago

Looks good. Based on reading the issue, there is no way to wrap the code under test in an Assert.Throws?

BTW, I edited your PR description a bit so it will auto-close the issue. I hope that was the intention.

pvlakshm commented 8 years ago

There are two changes I looked at: (1) where IntelliTest asks the generator about what to use for attributing an expected exception (https://github.com/nunit/nunit-vs-testgenerator/blob/master/IntelliTest.NUnit/NUnitTestFramework.cs#L157). The change tells IntelliTest to not use attribution for expected exceptions. (2) The change at TryMarkExpectedException where an executing test is monitored to see whether it is throwing any expected exception.

Both of these look good.

OsirisTerje commented 8 years ago

@rprouse THat would be preferable, but this is outside the code we can change, afaik. We could possibly extend the base class itself, but we need to look into if that is enough. @pvlakshm : Comments? Can it be done? Further, this code lacks unit tests, and I am not sure at all how we can unit test it, too little knowledge about the framework it extends. Perhaps @pvlakshm can add something?