質問

I'm trying to write some unit tests for a Sharepoint 2010 Webpart that uses UserProfile manager. In order to mock UserProfileManager, I also need to mock SPServiceContext.

When I try to assign my mock variable, like this:

_mockServiceContext = Mock.Create<SPServiceContext>();

The following exception is thrown:

Type 'Telerik.JustMock.MockException' in assembly 'Telerik.JustMock, Version=2013.1.507.0, Culture=neutral, PublicKeyToken=721b6c5bc0326b3a' is not marked as serializable.

Any idea what I'm doing wrong?

役に立ちましたか?

解決

Thank you for reporting this issue.

It appears this is a bug in JustMock 2013 Q1 SP2 which has already been fixed. The fix will be included in the upcoming internal build due this month. An internal build is a preview of our upcoming major release - Q2 2013. So please give it a try once it's out and let us know what your feedback is.

I hope this information helps.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top