Has anyone successfully managed to run unit tests for their Monotouch project? I have read other posts where people are told to manually add references to the appropriate assemblies. Doing this makes the project compile, but it will still not run the tests.
I have a solution with two projects; a Monotouch Navigation project and an NUnit Library Project. I added a reference to my monotouch project and to the monotouch and other needed assemblies to the test project. Tests that only runs code outside the monotouch assembly will run fine, the ones that accesses monotouch code fails with:
System.IO.IOException: Write failure ---> System.Net.Sockets.SocketException: The socket has been shut down at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in :0 at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in :0 --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in :0 at System.IO.BufferedStream.Flush () [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.IO.BufferedStream:Flush () at System.IO.BufferedStream.Dispose (Boolean disposing) [0x00000] in :0 at System.IO.Stream.Close () [0x00000] in :0 at Mono.Remoting.Channels.Unix.ClientConnection.ProcessMessages () [0x00000] in :0
I found a post saying: "..if you're not running on the iPhone or in the iPhone simulator, there's no way to call the necessary native APIs to instantiate the components.."
So what I´m really wondering is if it´s actually possible to do unit testing in Monotouch at the moment, or if not, what all you other guys do?
Thanks!