Export to GitHub

moq - issue #384

Callback not beeing called in current version 4.2.1506.2016


Posted on Jun 23, 2015 by Happy Bird

What steps will reproduce the problem?

I'm mocking a async WCF call the following way

svc.Setup(s => s.BeginStartWorkTimeLogging(It.IsAny<TpAuthentication>(), It.IsAny<Guid>(), It.IsAny<Guid?>(), It.IsAny<Guid?>(), It.IsAny<string>(), It.IsAny<DateTime?>(), It.IsAny<AsyncCallback>(), null)) .Callback<TpAuthentication, Guid, Guid?, Guid?, string, DateTime?, AsyncCallback, object>( (auth, projectId, taskId, customerId, description, logonTime, callback, state) => { callback(aresult); }) .Returns(aresult); svc.Setup(s => s.EndStartWorkTimeLogging(out fault, out todayEntries, It.IsAny<IAsyncResult>())) .Returns(activeTimeEntry);

What is the expected output? What do you see instead?

The expected behaviour is that the callback method is beeing called. Such is working through Version 4.2.1502.911 of MOQ

Starting with Version 4.2.1506.2016 the callback method won't be called anymore. The test runs without any technical exception, but it fails because the callback method won't be called.

What version of the product are you using? On what operating system?

I'm using the .NET Framework 4.52

Please provide any additional information below.

The strange Thing is, that I have several tests that Mocks different WCF calls. But only some are failing because of the callback not beeing called.

Status: New

Labels:
Type-Defect Priority-Medium