General

I suggest you ...

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  1. Provide a callback before returning default mocks as values

    When you set up a Mock with DefaultValue.Mock it will return mock instances for any members that don't have Setups defined.

    I'm doing a lot of work with AutoMocking containers, and in that scenario it would be really nice to have a callback that would allow me to intercept this behavior.

    My AutoMocking container will take care of returning a mock of IFoo, and with DefaultValue.Mock, a member will automatically return a mock of IBar.

    However, I would really like to be able to say that "whenever Moq tries to return IBaz from an IBar method, I want to be…

    18 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      planned  ·  kzuAdminkzu (Admin, moq) responded

      yes, we had a request to allow the default value strategy be open (it’s already pluggable internally)

    • Introduce a MoqException to wrap fex. ArgumentException

      I had a Unit Test with following attribute: [ExpectedException(typeof(ArgumentException))]
      So the test would succeed when this exception was thrown.

      But because I was incorrectly using Moq, my test would always pass. During the Setup() method, Moq was throwing an ArgumentException. Now if incorrect usage (fex using a sealed class to mock, or a property that's not defined as virtual) would throw MoqException, the test would fail, causing me to search for the problem.

      4 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        1 comment  ·  Admin →
      • Make it possible to verify the number of times a protected member was invoked

        It would be nice if protected setups could be verified using Times (Never, Once, etc.) just like normal setups.

        13 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
        • Don't see your idea?

        General

        Feedback and Knowledge Base