문제

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