danielwertheim

danielwertheim


notes from a passionate developer

Share


Sections


Tags


Disclaimer

This is a personal blog. The opinions expressed here represent my own and not those of my employer, nor current or previous. All content is published "as is", without warranty of any kind and I don't take any responsibility and can't be liable for any claims, damages or other liabilities that might be caused by the content.

Confusing design decisions for the testing framework in Visual Studio

I do get that WinRT (or whatever name it has) is not .Net, and that it supports a subset of .Net BCL, but I can not for my life understand, why you design something in a way that the quality tools, the testing framework builtin to Visual Studio 2012 has gained different namespaces?

I’m most likely doing something really wrong, but in a project of mine, I couldn’t make use of portable class libraries and instead had to go with multiple projects targeting different frameworks, where all the .cs files has been added as linked files. While doing this, I also ported all my tests from NUnit to MSTest so that I could test WinRT in a more “correct” manner. The result? Ugly code like this:

#if !WinRT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
#endif

Why on earth would you design so that the namespaces changes depending on the target platform, when it is being used within the same tool and surely they must have foreseen that people (like me) will have to have the same setup as I created?

I’m glad I’m not working with writing Windows store apps, because just porting my little driver library for CouchDB, to support Windows store apps, has been a pain.

//Daniel

View Comments