moq

Installation
SKILL.md

Moq Skill

Moq is the mocking framework used throughout VanDaemon for unit testing. All services are registered as singletons and depend on interfaces, making them ideal candidates for mocking. Tests use Mock<T> to create test doubles, Setup() to configure behavior, and Verify() to assert interactions.

Quick Start

Basic Service Mock

// Mock a service interface
var mockTankService = new Mock<ITankService>();
mockTankService
    .Setup(x => x.GetAllTanksAsync(It.IsAny<CancellationToken>()))
    .ReturnsAsync(new List<Tank> { new Tank { Id = Guid.NewGuid(), Name = "Fresh Water" } });

var controller = new TanksController(mockTankService.Object);

Mock with Argument Matching

Related skills
Installs
2
GitHub Stars
1
First Seen
Mar 1, 2026