AmbiguousMatchException on attempting to Mock an Interface

7 posts, 0 answers
  1. Nick
    Nick avatar
    8 posts
    Member since:
    Apr 2011

    Posted 06 Sep 2011 Link to this post

    Hello,

    I receive this excpetion when this code Mock.Create<IRepositoryStore>(); executes.

    All other mocks on interfaces are working except this one.  I cant find a duplicate definition of the interface anywhere.

    It's only started happening recently.  Any clues?

    Regards,

    Nick


  2. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 08 Sep 2011 Link to this post

    Hi Nick,

    Thanks again for sending the issue. At this point i would request if it is possible to send me the structure of IRepsorityStore interface so that i can reproduce the exception in local machine and possibly come up with a fix if required.


    Kind Regards,
    Mehfuz
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft R3 2016 release webinar banner
  4. DenisCL
    DenisCL avatar
    69 posts
    Member since:
    Dec 2009

    Posted 21 Sep 2011 Link to this post

    I Have the same with the latest release (Q2 2011) while trying to mock NHibernate ISession.
    I'm using VS2010 Premium + MsTests and NHibernate 3.0.

    I Didn't have it with the first Q1 2010.

    The test is very simple and fails :

     

            [TestMethod]
            public void TestMethod1()
            {
                var session = Mock.Create<ISession>();
            }
    Thanks
  5. Nick
    Nick avatar
    8 posts
    Member since:
    Apr 2011

    Posted 21 Sep 2011 Link to this post

    Can you please try with this example...
  6. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 22 Sep 2011 Link to this post

    Hi Nick and Denis,

    Thanks again for taking time in pointing the issue.

    However i found the problem and therefore should you need an internal build urgently please create a support ticket where i will attach the latest version of Telerik.JustMock.dll.

    Hopefully that will resolve the exception.

    Kind Regards
    Mehfuz
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Nick
    Nick avatar
    8 posts
    Member since:
    Apr 2011

    Posted 22 Sep 2011 Link to this post

    When do you think it will be put into your nuget package?  Would rather have it there.
  8. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 23 Sep 2011 Link to this post

    Hi Nick,

    Thanks again for the reply.

    The fix will be uploaded to NuGet in few weeks time along with the SP1 update. But if you need the fix urgently, you need to create a support ticket (since i can’t send internal builds to public forum) where i will send you the latest build that contains the patch.
    Kind Regards,
    Mehfuz
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft R3 2016 release webinar banner