Hello guys!
I get a Telerik.JustMock.Core.ElevatedMockingException when I run: Mock.Arrange(() => _client.GetAsync(Arg.IsAny<string>())).Returns(ShowMeTheMoney());
static async Task<HttpResponseMessage> ShowMeTheMoney()
{
HttpRequestMessage httpRequest = new HttpRequestMessage();
httpRequest.SetConfiguration(new HttpConfiguration());
HttpResponseMessage response = httpRequest.CreateResponse(HttpStatusCode.OK, new List<SmsDTO>() { new SmsDTO()});
return response;
}
[TestMethod]
public void GetAll_NullResultTes3t()
{
//Assert.IsTrue(Mock.IsProfilerEnabled);
_client = Mock.Create<HttpClient>();
_controller = new SmsController(new Persistence(_client));
_controller.Request = new HttpRequestMessage();
Mock.Arrange(() => _client.GetAsync(Arg.IsAny<string>())).Returns(ShowMeTheMoney());
IEnumerable<SmsDTO> actualResult = _controller.GetAll();
CollectionAssert.AllItemsAreNotNull(actualResult.ToList());
}
I use VS2015 Enterprise and I have disabled IntelliTrace(Tools>Options>IntelliTrace: Uncheck the Enable IntelliTrace checkbox). Also I enabled the profiler from the JustMock Menu.
I get the following in Event logs:
Info: .NET Runtime version 4.0.30319.0 - The profiler has requested that the CLR instance not load the profiler into this process. Profiler CLSID: '{9999995d-2cbb-4893-be09-fce80abc7564}'. Process ID (decimal): 7808. Message ID: [0x2516].
Info: TraceLog Profiler component initialized successfully, process vstest.executionengine.x86.exe
Info: .NET Runtime version 4.0.30319.0 - The profiler was loaded successfully. Profiler CLSID: '{9999995d-2cbb-4893-be09-fce80abc7564}'. Process ID (decimal): 7724. Message ID: [0x2507].
Error:
The description for Event ID 0 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Error Handler Exception: System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.PipeException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)
at System.ServiceModel.Channels.StreamConnection.EndRead()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) \r\n at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
the message resource is present but the message is not found in the string/message table
Info: .NET Runtime version 4.0.30319.0 - The profiler has requested that the CLR instance not load the profiler into this process. Profiler CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}'. Process ID (decimal): 6696. Message ID: [0x2516].
According to regedit, CLSID: '{9999995d-2cbb-4893-be09-fce80abc7564} corresponds to IntelliTrace and CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}' to CodeWeaverProfiler class.
Could you please help?
Thanks!