Top "Moq" questions

Moq is a strongly typed and minimalistic mocking framework for .NET.

Mocking classes that implement IQueryable with Moq

I spent an evening trying to mock an object that implements IQueryable: public interface IRepo<T> : IQueryable<…

c# unit-testing mocking moq
How to do internal interfaces visible for Moq?

I have 3 project in my C# solution. Signatures Structures Tests Signatures has public and internal interfaces. Also it has [assembly: …

c# unit-testing nunit moq internals
Mocking virtual readonly properties with moq

I couldn't find a way to do this, though this can be done by hand so why not with moq?

unit-testing tdd mocking moq
Unsupported expression: Non-overridable members (here: ) may not be used in setup / verification expressions

I am using xUnit and Moq for writing test cases. I am using the code below to create a Mock …

.net .net-core moq xunit
Can I use Moq to verify that a mocked method was called with specific values in a complex parameter?

So assume I am mocking the following class: public class ClassAParams { public int RequestedId { get; set; } public string SomeValue { get; …

c# unit-testing parameters moq
Mock.Of<Object> VS Mock<Object>()

I'm currently confuse on how to mock. I'm using Moq. To mock objects I usually write this way var mockIRepo = …

c# unit-testing testing mocking moq
How to create a stub with Moq

How do I creat a pure stub using Moq? With Rhino Mocks I did it like this: [TestFixture] public class …

c# asp.net-mvc-3 nunit moq rhino-mocks
MVC 3: How to learn how to test with NUnit, Ninject, and Moq?

Short version of my questions: Can anyone point me toward some good, detailed sources from which I can learn how …

unit-testing asp.net-mvc-3 nunit moq ninject-2
Mock IHttpContextAccessor in Unit Tests

I have a method to get header value using IHttpContextAccessor public class HeaderConfiguration : IHeaderConfiguration { public HeaderConfiguration() { } public string GetTenantId(IHttpContextAccessor …

c# unit-testing asp.net-core moq asp.net-core-webapi
Using Moq to Stub an interface method

Possible Duplicate: How to mock a method that returns an int with MOQ Here's my interface: public interface ICalenderService { DateTime …

c# .net unit-testing moq stub