I’m getting the following error when trying to mock a static function in a silverlight unit test:
“There were some problems intercepting the mock call. Optionally, please make sure that you have turned on JustMock's profiler while mocking concrete members.”
I don’t get the error in a full .NET unit test project, so, I wondered whether I was missing a setting or something?
My code from my silverlight unit test project is below. I get the error on the Mock.Arrange() line
Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports Telerik.JustMock
<
TestClass
()> _
Public Class Tests
<
TestMethod
()> _
Public Sub SharedMethodMustBeCalled()
Mock.Arrange(Function() SharedStuff.GetSomething(Arg.AnyString)).MustBeCalled()
Dim SomeClass As New SomeClass
Dim ret As String = SomeClass.DoSomething()
Mock.Assert(SomeClass)
End Sub
Public Class SomeClass
Public Function DoSomething() As String
Dim ret As String = SharedStuff.GetSomething("fred")
Return ret
End Function
End Class
Public Class SharedStuff
Public Shared Function GetSomething(ByVal Name As String) As String
Return "test"
End Function
End Class
End Class