Daniel Cazzulino

Results 360 comments of Daniel Cazzulino

Invoking virtual members from a constructor is pretty much an anti-pattern. There seems to be [some support for that](https://github.com/devlooped/moq/blob/main/src/Moq/ActionObserver.cs#L280-L285) but I don't even know why supporting that (however imperfectly) would...

Hi there. Yes, the lack of a public API for consuming matchers against invocations are a limitation of the current approach. This should be addressed in a future Moq.

You should be able to set the return value value to `Task.FromResult(Mock.OfType())`, I think.

If you submit a PR for this, I'd gladly merge it.

Yeah, fixing old changelogs is low on the list. Thanks for pointing it out though :)

You can leverage `UnsafeAccessorAttribute` for this. ```csharp public class MyProvider(DefaultValueProvider inner) : DefaultValueProvider { [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "GetDefaultValue")] static extern object GetDefaultValueInner(DefaultValueProvider provider, Type type, Mock mock); protected override object...

Sounds like you'd need a binding redirect for that assembly

Verify is used to match against invocations on the mock. Casting the object to another type does not involve any invocations on it (by default, unless you're trying to test...

Easiest way to detect whether you're missing a setup (or the compiler is not picking the overload you think it should be picking) is to set the mock to `MockBehavior.Strict`...

Thanks for the PR! Could you rebase on top of main, since files moved around?