質問

I have just been assigned a task to implement a unit testing strategy for a small development team using c sharp on visual studio 2012 professional edition (which doesn't include the powerful full version of MS testing module (test manager, test center, ability to generate unit tests automatically, etc)).

After searching from the web and read a lot of articles about unit testing in visual studio, I have come up with a few options such as "nUnit", "xUnit.net" and the integrated MS unitTest coming with Visual Studio 2012 professional.(Because its only professional version, I just fund the function is very limited). Can anybody with experience in this field help me to select a right tool? If you have any other suggestions please specify.

Also, we need to pick up a "fake" framework for creating "stub" and "drivers" for module testing as well. Since we still only have the VS 2012 professional version, we don't have access to the "MS fakes". I know "Moq" could be a good solution. I would love anybody could suggest any better option.

Thanks

役に立ちましたか?

解決

I also recommend NUnit as a great starting point for your unit testing, because it is free, it has integration into Visual Studio (if you wish, but also can run standalone as well) and also can complement other testing frameworks (like MSTest) if you decide to use/buy later. In other words, you could have tests written using NUnit and MSTest coexisting.

Read A Step-by-Step Beginner Tutorial on Writing Unit Tests NUnit with C#.

As for mocking, I recommend the following:

  • Moq - free and regularly updated on GitHub
  • Rhino Mocks - free and regularly updated on website
  • TypeMock - not free, but extremely powerful mocking framework that allows you to mock concrete types (including sealed classes) which allows you to test third party software, such as SharePoint, etc.

他のヒント

I use nUnit And it's great.

You can also "Mock" objects, if this is what you mean by: ""fake" framework for creating "stub" and "drivers""

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top