Andy
Andy

Reputation: 2603

How to mock/stub a Java object in C# code?

My C# code is using a class written in Java (IKVM). That Java class provides 2 methods that I am calling in my C# code:

  1. GetInstance() - It simply returns the instance of that Java class.
  2. GetSet() - returns a java.util.Set that I iterate over to do some processing.

We use NUnit and NMock and I am relatively new to mocking/stubbing, so I am quite confused on how to write unit test cases for this piece of C# code which will return a Java object etc.

Any help/pointers would be highly appreciated. Thanks.

Upvotes: 0

Views: 122

Answers (0)

Related Questions