I know this maybe a very basic question but I’m having a bit of a mind blank at the moment. Should I be unit testing this class.
public class MapinfoWindowHandle : IWin32Window { IntPtr handle; public MapinfoWindowHandle(IntPtr mapinfoHandle) { this.handle = mapinfoHandle; } #region IWin32Window Members IntPtr IWin32Window.Handle { get { return this.handle; } } #endregion }
If I should be what should I be testing for?
I use it like this:
IntPtr handle = new IntPtr(100); myform.show(new MapinfoWindowHandle(handle));
The only thing that I can see is making sure you get out the handle that you put in via your constructor. I know that it’s obvious that you implemented it this way, but a test would assure you that it stays this way. I would test this only because you are injecting it via the constructor. If it was just { get; set; } I probably wouldn’t.