I'm currently evaluating JustMock for a Windows Store App that I'm developing.
I've tried this code:
var mock = Mock.Create<ConnectionProfile>(Constructor.NotMocked);
Assert.AreEqual(NetworkConnectivityLevel.ConstrainedInternetAccess, mock.GetNetworkConnectivityLevel());
And it fails with the following exception:
Result Message: Test method JustMockWinRtTypes.UnitTest1.MockTest threw exception:
Telerik.JustMock.MockException: Failed to create instance of type 'Windows.Networking.Connectivity.ConnectionProfile'
Result StackTrace:
at Telerik.JustMock.Core.MocksRepository.CreateExternalMockMixin(Type mockObjectType, Object mockObject, IEnumerable`1 mixins, IEnumerable`1 supplementaryBehaviors, IEnumerable`1 fallbackBehaviors)
at Telerik.JustMock.Core.MocksRepository.Create(Type type, MockCreationSettings settings)
at Telerik.JustMock.MockBuilder.Create(MocksRepository repository, Type type, Object[] constructorArgs, Nullable`1 behavior, Type[] additionalMockedInterfaces, Nullable`1 mockConstructorCall, IEnumerable`1 additionalProxyTypeAttributes, List`1 supplementaryBehaviors, List`1 fallbackBehaviors, List`1 mixins, Expression`1 interceptorFilter)
at Telerik.JustMock.Mock.<>c__DisplayClass81`1.<Create>b__80()
at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal[T](Func`1 guardedAction)
at Telerik.JustMock.Mock.Create[T](Constructor constructor)
at JustMockWinRtTypes.UnitTest1.MockTest() in c:\Source Code\Spikes\JustMockWinRtTypes\JustMockWinRtTypes\UnitTest1.cs:line 22
Can you tell me what I need to do to make this work?
Thanks
Simon
I've tried this code:
var mock = Mock.Create<ConnectionProfile>(Constructor.NotMocked);
Assert.AreEqual(NetworkConnectivityLevel.ConstrainedInternetAccess, mock.GetNetworkConnectivityLevel());
And it fails with the following exception:
Result Message: Test method JustMockWinRtTypes.UnitTest1.MockTest threw exception:
Telerik.JustMock.MockException: Failed to create instance of type 'Windows.Networking.Connectivity.ConnectionProfile'
Result StackTrace:
at Telerik.JustMock.Core.MocksRepository.CreateExternalMockMixin(Type mockObjectType, Object mockObject, IEnumerable`1 mixins, IEnumerable`1 supplementaryBehaviors, IEnumerable`1 fallbackBehaviors)
at Telerik.JustMock.Core.MocksRepository.Create(Type type, MockCreationSettings settings)
at Telerik.JustMock.MockBuilder.Create(MocksRepository repository, Type type, Object[] constructorArgs, Nullable`1 behavior, Type[] additionalMockedInterfaces, Nullable`1 mockConstructorCall, IEnumerable`1 additionalProxyTypeAttributes, List`1 supplementaryBehaviors, List`1 fallbackBehaviors, List`1 mixins, Expression`1 interceptorFilter)
at Telerik.JustMock.Mock.<>c__DisplayClass81`1.<Create>b__80()
at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal[T](Func`1 guardedAction)
at Telerik.JustMock.Mock.Create[T](Constructor constructor)
at JustMockWinRtTypes.UnitTest1.MockTest() in c:\Source Code\Spikes\JustMockWinRtTypes\JustMockWinRtTypes\UnitTest1.cs:line 22
Can you tell me what I need to do to make this work?
Thanks
Simon