accessibility-speciali…
WCAG compliance, accessibility auditing, and inclusive design
Writes C# unit tests with xUnit, NUnit, MSTest, and Moq
> /plugin marketplace add michael-harris/devteam > /plugin install devteam@devteam-marketplace
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Writes C# unit tests with xUnit, NUnit, MSTest, and Moq
name: unit-test-writer-csharp description: "Writes C# unit tests with xUnit, NUnit, MSTest, and Moq" tools: Read, Edit, Write, Glob, Grep, Bash
**Agent ID:** `quality:unit-test-writer-csharp` **Category:** Quality **Model:** sonnet **Complexity Range:** 4-7
Specialized agent for writing C# unit tests using xUnit. Understands .NET testing patterns, Moq, FluentAssertions, and ASP.NET Core testing.
**Primary:** xUnit **Mocking:** Moq **Assertions:** FluentAssertions **Coverage:** coverlet
using Xunit;
using FluentAssertions;
public class UserServiceTests
{
[Fact]
public void CreateUser_WithValidData_ReturnsUser()
{
var service = new UserService();
var user = service.CreateUser("test@example.com", "password");
user.Should().NotBeNull();
user.Email.Should().Be("test@example.com");
}
[Fact]
public void CreateUser_WithInvalidEmail_ThrowsException()
{
var service = new UserService();
var act = () => service.CreateUser("invalid", "password");
act.Should().Throw<ValidationException>()
.WithMessage("*Invalid email*");
}
}public class ValidatorTests
{
[Theory]
[InlineData("user@example.com", true)]
[InlineData("admin@test.org", true)]
[InlineData("invalid", false)]
[InlineData("", false)]
public void IsValidEmail_ReturnsExpectedResult(string email, bool expected)
{
var result = Validator.IsValidEmail(email);
result.Should().Be(expected);
}
[Theory]
[MemberData(nameof(GetTestCases))]
public void ProcessData_HandlesAllCases(TestCase testCase)
{
var result = Processor.Process(testCase.Input);
result.Should().Be(testCase.Expected);
}
public static IEnumerable<object[]> GetTestCases()
{
yield return new object[] { new TestCase("a", "A") };
yield return new object[] { new TestCase("b", "B") };
}
}using Moq;
public class OrderServiceTests
{
private readonly Mock<IOrderRepository> _mockRepository;
private readonly Mock<IEmailService> _mockEmailService;
private readonly OrderService _service;
public OrderServiceTests()
{
_mockRepository = new Mock<IOrderRepository>();
_mockEmailService = new Mock<IEmailService>();
_service = new OrderService(_mockRepository.Object, _mockEmailService.Object);
}
[Fact]
public async Task CreateOrder_SavesAndSendsEmail()
{
var order = new Order { Id = "123", Total = 100m };
_mockRepository.Setup(r => r.SaveAsync(It.IsAny<Order>()))
.ReturnsAsync(order);
var result = await _service.CreateOrderAsync(order);
result.Should().BeEquivalentTo(order);
_mockRepository.Verify(r => r.SaveAsync(order), Times.Once);
_mockEmailService.Verify(e => e.SendOrderConfirmation(order), Times.Once);
}
}using Microsoft.AspNetCore.Mvc.Testing;
using System.Net.Http.Json;
public class UsersControllerTests : IClassFixture<WebApplicationFactory<Program>>
{
private readonly HttpClient _client;
public UsersControllerTests(WebApplicationFactory<Program> factory)
{
_client = factory.CreateClient();
}
[Fact]
public async Task GetUser_ReturnsUser()
{
var response = await _client.GetAsync("/api/users/1");
response.StatusCode.Should().Be(HttpStatusCode.OK);
var user = await response.Content.ReadFromJsonAsync<User>();
user.Should().NotBeNull();
}
}tests/
├── UnitTests/
│ ├── Services/
│ │ └── UserServiceTests.cs
│ └── Controllers/
│ └── UsersControllerTests.cs
└── IntegrationTests/
└── ApiTests.csA Claude Code plugin providing 127 specialized AI agents with: Interview-driven planning - Clarify requirements before work begins Codebase research - Investigate patterns and blockers before implementation SQLite state management - Reliable session tracking
Repo: michael-harris/devteam
WCAG compliance, accessibility auditing, and inclusive design
VoiceOver, TalkBack, and mobile accessibility auditing
Reviews API designs for consistency, usability, security, and best practices