Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback not beeing called in current version 4.2.1506.2016 #183

Closed
BitKFu opened this issue Jun 23, 2015 · 6 comments
Closed

Callback not beeing called in current version 4.2.1506.2016 #183

BitKFu opened this issue Jun 23, 2015 · 6 comments

Comments

@BitKFu
Copy link

BitKFu commented Jun 23, 2015

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.

@rbirkby
Copy link

rbirkby commented Jun 24, 2015

According to #184, this appears to be caused by the nullable types. I'm seeing the same behavior.

@pkpjpm
Copy link
Contributor

pkpjpm commented Jun 25, 2015

PR 185 should close this

@kzu
Copy link
Member

kzu commented Jun 25, 2015

PR merged and nuget pushed. Plz verify if the issue is fixed and close if so?

Tnx!

@rbirkby
Copy link

rbirkby commented Jun 25, 2015

About 1% of our tests were failing with 4.2.1506.2016.
Now with the new build (from nuget), they all succeed. Thanks

@kzu
Copy link
Member

kzu commented Jun 25, 2015

yay! :)

@kzu kzu closed this as completed Jun 25, 2015
@BitKFu
Copy link
Author

BitKFu commented Jun 25, 2015

Thanks, will try it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants