Skip to main content

Parameterized Unit Tests with MSTest (Metro)

I spent a long time looking for this last night as I was trying to decide if I should use MSTest, NUnit, XUnit, or something else on the Windows Store app that I've been developing.

One of the things I've used in the past with NUnit was the ability to create test cases like so:

  1. [TestCase(12,3,4)]
  2. [TestCase(12,2,6)]
  3. [TestCase(12,4,3)]
  4. public void DivideTest(int n, int d, int q)
  5. {
  6.   Assert.AreEqual( q, n / d );
  7. }

(example taken directly from the NUnit documentation here)

However, since I'd used NUnit before and since this was a side-project (no time/budget restrictions) I decided to learn some MSTest. In adding the test project and a reference to my application as well as watching a video from build on Unit Testing Windows 8 store apps I found it nice, easy, and clean. So I went looking for where this feature which to me is a huge, necessary feature and I couldn't find it... So I googled, and I googled, and I googled...

Resizing an image within a Windows 8 app in C#

I'm creating an application where a user can add their own images. Accepting a user's pictures is handy and all but when modern digital cameras regularly take pictures that are greater than 4MB that's not something I want stored in memory.

Here I have image data within a stream and want to resize it to a given width and height - while maintaining aspect ratio. This accomplishes the task nicely...

Reading a StorageFile to a byte array in C#

Reading a StorageFile to a byte[] or an IRandomAccessStream in a Windows 8 app wasn't exactly obvious and the examples I found included other classes or unnecessary processing. I created this solution based upon what I learned and wanted to share it...

Windows 8 App Store Development - License issues

I had some issues with gaining a developer's license. Visual Studio 2012 and Powershell were both unable to obtain a license. After some research I found that this seemed to be common to upgrades from Windows 7 to Windows 8. Additionally, I had already had Visual Studio 2012 installed before the update.

It seemed to be a variety of different error codes - many of which didn't apply to me.

I didn't find that windows update had any updates for me - required or otherwise. However, this seemed to fix the issue anyway:

http://support.microsoft.com/kb/2687198

Windows 8 - User Impressions

I know the last post came down on Windows 8 a bit but I'm ready to move beyond and get into what the operating system itself is really like. I've had some time to work with Windows 8 and there's some things I really like and some things that I think need polish. I approached it from the standpoint of the modern user. The modern user isn't going to read help files unless something is majorly wrong. They aren't going to study how to use Windows. They are just going to approach it using the tried and true methods of the past and adjusting as they need to.