Unit testing and PInvoking pt. 2

31. August 2008

In part one of this series of posts I explained how I usually set up PInvoke calls. I showed how to hide the calls themselves from consuming code so they don't have to duplicate the pre and postprocessing that's often needed. And I briefly showed how you could make the wrapper-calls non-static so you can mock the class they're in and that way test the consuming code. In this post I'll show exactly how to do this using the new Rhino Mocks 3.5 AAA model.

More...

Unit testing and PInvoking

28. August 2008

I'm big on unit testing, I like to test everything and I feel uncomfortable when I'm unable to write tests for some of my code. So even though some parts of your application are hard to test I'm willing to take some extra time to make them testable. In this post I want to show you some tricks I use to unit-test code that uses platform invoked functions.

More...

Marshalling strings with StringBuilder

20. August 2008

The dotNet framework is pretty smart when it comes to marshalling managed to unmanaged datatypes for PInvoke calls. When you want to pass a Guid from the managed to the unmanaged world the framework knows how to transform the .Net Guid structure to a Windows GUID without you even asking for it. More...

PInvoke, managed and unmanaged datatypes

17. August 2008

I'm doing a lot of PInvoking lately. One of the hard parts is mapping the unmanaged datatypes found in c++ include files to managed datatypes.

I found a nice article on codeproject with a list of the most common mappings. I'll repeat the list here so I can find it easilly, maybe other people can benefit from it too. I'll keep the list up-to-date with my own mappings and some remarks. More...

Moved again

16. August 2008

Due to a job-change my weblog moved again.

I had some problems exporting my old blogposts. My old blog ran on Subtext and it had some problems exporting BlogML. There were some other problems with subtext I ran into so on my new weblog I'll be trying out blogengine.net.

As long as my previous employer doesn't mind hosting them I won't be moving my old posts here. If you want to read them you can find them with the other Enigmatry bloggers over here.

For now I'll just say welcome to my new blog. I hope to have time to start blogging again soon.

Powered by BlogEngine.NET 1.5.0.7
Theme adapted from BlogEngine.NET standard theme by Mads Kristensen

Mendelt Siebenga

Mendelt Siebenga with coffeeMendelt Siebenga works as a C# programmer. In his spare time he's been known to pick up Python, Lisp and even a soldering iron from time to time.

You can also find me here

My book-pick