Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created April 15, 2026 12:49
Show Gist options
  • Select an option

  • Save dcomartin/043d18ad54a8dd0a2bfedb7ca40fb1a0 to your computer and use it in GitHub Desktop.

Select an option

Save dcomartin/043d18ad54a8dd0a2bfedb7ca40fb1a0 to your computer and use it in GitHub Desktop.
public class Tests
{
[Fact]
public async Task Test()
{
var mock = new Mock<IVinDecoderService>();
mock.Setup(x => x.Lookup("123456789"))
.ReturnsAsync(new VinDecoderResult
{
Make = "Ford",
Model = "F-150",
Year = 2026
});
var sut = new RegisterVehicleHandler(mock.Object);
var result = await sut.Handle(new RegisterVehicle("123456789"), CancellationToken.None);
Assert.Equal("2026 Ford F-150", result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment