Moq

A C# library used in unit testing to create fake objects.

What is Moq?

A C# mocking library used in unit testing to create fake objects, simulate dependencies, and verify interactions without relying on real implementations.

var mock = new Mock<IUserService>();
mock.Setup(x => x.GetName()).Returns("John");
string name = mock.Object.GetName(); // "John"

Level: Novice · More C# terms at this level

Updated