简体   繁体   中英

What is equivalent of moq.As in JustMock?

I am stuck to mock Entity Framework 6 asynchronous methods using JustMock. I searched in Google a lot but did not get any sufficient result. At last I got an example at testing with async queries but it is used Moq.

I am try to convert this into JustMock but i can not find anything like .As<TInterface>() in JustMock. Please tell me what is equivalent of moq.As in JustMock ?

Seems that there is no pure equivalent option on this framework to Moq.As<TInterface> .

But, on Telerik's official documentation , multiple interface mocking is explained using as C# protected word.

// Arrange
var foo = Mock.Create<IFoo>();
var iDisposable = foo as IDisposable; // <<<<<<<<<<<<<<<<<<<<<<<<<<<< 

Read this documentation and try the solution proposed to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM