views:

49

answers:

1

Hi,

I am trying to write a unit test for a method that uses a .net remoting object.

The remoting object is created by using Activator.GetObject(typeof(myRemotingObjectType), uri);

During runtime, the uri is server ip address of the remoting object.

Since I want to write a unit test, I don't want to initialize any .Net remoting to slowdown the test if possible.

Thanks

+5  A: 

I would suggest wrapping it and have the wrapper implement an interface. You can then swap the wrapper with a mock equivalent for testing purposes.

Paul Ruane
Are you suggesting I should wrap the Activator.GetObject() and pass it is as an interface?Thanks for the suggestion.
dsum