RajOpteamix / moq

Automatically exported from code.google.com/p/moq
Other
0 stars 0 forks source link

Callback not beeing called in current version 4.2.1506.2016 #384

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by gerhard....@googlemail.com on 23 Jun 2015 at 11:04