This is a migrated thread and some comments may be shown as answers.

AmbiguousMatchException on attempting to Mock an Interface

6 Answers 124 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 06 Sep 2011, 09:06 AM
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


6 Answers, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 08 Sep 2011, 09:22 AM
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 >>

0
DenisCL
Top achievements
Rank 1
answered on 21 Sep 2011, 10:52 AM
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
0
Nick
Top achievements
Rank 1
answered on 22 Sep 2011, 03:20 AM
Can you please try with this example...
0
Ricky
Telerik team
answered on 22 Sep 2011, 08:50 PM

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 >>

0
Nick
Top achievements
Rank 1
answered on 23 Sep 2011, 02:18 AM
When do you think it will be put into your nuget package?  Would rather have it there.
0
Ricky
Telerik team
answered on 23 Sep 2011, 03:20 PM
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 >>

Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Ricky
Telerik team
DenisCL
Top achievements
Rank 1
Nick
Top achievements
Rank 1
Share this question
or