{"id":18937416,"url":"https://github.com/verifytests/verify.wolverine","last_synced_at":"2026-03-17T11:34:02.890Z","repository":{"id":64953503,"uuid":"577237207","full_name":"VerifyTests/Verify.Wolverine","owner":"VerifyTests","description":"Adds Verify support for verifying Wolverine via a custom test context.","archived":false,"fork":false,"pushed_at":"2025-04-14T11:25:12.000Z","size":457,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:30:18.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VerifyTests.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"VerifyTests"}},"created_at":"2022-12-12T09:40:21.000Z","updated_at":"2025-04-14T11:25:15.000Z","dependencies_parsed_at":"2024-05-02T16:29:21.385Z","dependency_job_id":"654b09d6-d4e0-4bf9-a0f2-49381b99c423","html_url":"https://github.com/VerifyTests/Verify.Wolverine","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.04166666666666663,"last_synced_commit":"fce24c627cb3cd3586927832708cb6411bc5b568"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.Wolverine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.Wolverine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.Wolverine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.Wolverine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VerifyTests","download_url":"https://codeload.github.com/VerifyTests/Verify.Wolverine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129225,"owners_count":21217308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T12:11:05.832Z","updated_at":"2026-03-17T11:34:02.884Z","avatar_url":"https://github.com/VerifyTests.png","language":"C#","funding_links":["https://github.com/sponsors/VerifyTests"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"/src/icon.png\" height=\"30px\"\u003e Verify.Wolverine\n\n[![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true\u0026label=)](https://github.com/orgs/VerifyTests/discussions)\n[![Build status](https://img.shields.io/appveyor/build/SimonCropp/Verify-Wolverine)](https://ci.appveyor.com/project/SimonCropp/Verify-Wolverine)\n[![NuGet Status](https://img.shields.io/nuget/v/Verify.Wolverine.svg)](https://www.nuget.org/packages/Verify.Wolverine/)\n\nAdds [Verify](https://github.com/VerifyTests/Verify) support for verifying [Wolverine](https://github.com/JasperFx/wolverine) via a custom test context.\u003c!-- singleLineInclude: intro. path: /docs/intro.include.md --\u003e\n\nUses the same pattern as the [Wolverine TestMessageContext](https://wolverine.netlify.app/guide/testing.html#testmessagecontext) with some additions:\n\n * All messaging parameters, eg DeliveryOptions and timeout, can be asserted.\n * Support for `IMessageBus.InvokeAsync\u003cT\u003e` via [AddInvokeResult](#addinvokeresult).\n\n**See [Milestones](../../milestones?state=closed) for release notes.**\n\n\n## Sponsors\n\n\n### Entity Framework Extensions\u003c!-- include: sponsors. path: /docs/sponsors.include.md --\u003e\n\n[Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp\u0026utm_medium=Verify.Wolverine) is a major sponsor and is proud to contribute to the development this project.\n\n[![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.Wolverine/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp\u0026utm_medium=Verify.Wolverine)\n\n### Developed using JetBrains IDEs\n\n[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSourceSupport)\u003c!-- endInclude --\u003e\n\n\n## NuGet\n\n * https://nuget.org/packages/Verify.Wolverine\n\n\n## Usage\n\n\u003c!-- snippet: Enable --\u003e\n\u003ca id='snippet-Enable'\u003e\u003c/a\u003e\n```cs\n[ModuleInitializer]\npublic static void Init() =\u003e\n    VerifyWolverine.Initialize();\n```\n\u003csup\u003e\u003ca href='/src/Tests/ModuleInitializer.cs#L3-L9' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-Enable' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Handler\n\nGiven the handler:\n\n\u003c!-- snippet: Handler --\u003e\n\u003ca id='snippet-Handler'\u003e\u003c/a\u003e\n```cs\npublic class Handler(IMessageBus context)\n{\n    public ValueTask Handle(Message message) =\u003e\n        context.SendAsync(new Response(\"Property Value\"));\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L28-L36' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-Handler' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Test\n\nPass in instance of `RecordingMessageContext` in to the `Handle` method and then `Verify` that instance.\n\n\u003c!-- snippet: HandlerTest --\u003e\n\u003ca id='snippet-HandlerTest'\u003e\u003c/a\u003e\n```cs\n[Fact]\npublic async Task HandlerTest()\n{\n    var context = new RecordingMessageContext();\n    var handler = new Handler(context);\n    await handler.Handle(new Message(\"value\"));\n    await Verify(context);\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L5-L16' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-HandlerTest' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\nWill result in:\n\n\u003c!-- snippet: Tests.HandlerTest.verified.txt --\u003e\n\u003ca id='snippet-Tests.HandlerTest.verified.txt'\u003e\u003c/a\u003e\n```txt\n{\n  Sent: [\n    {\n      Message: {\n        Property: Property Value\n      }\n    }\n  ]\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.HandlerTest.verified.txt#L1-L9' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-Tests.HandlerTest.verified.txt' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n### AddInvokeResult\n\nWhen using [Request/Reply](https://wolverine.netlify.app/guide/messaging/message-bus.html#request-reply) via `IMessageBus.InvokeAsync\u003cT\u003e` the message context is required to supply the \"Reply\" part. This can be one using `RecordingMessageContext.AddInvokeResult\u003cT\u003e`.\n\nFor example, given the handler:\n\n\u003c!-- snippet: InvokeAsyncHandler --\u003e\n\u003ca id='snippet-InvokeAsyncHandler'\u003e\u003c/a\u003e\n```cs\npublic class Handler(IMessageBus context)\n{\n    public async Task Handle(Message message)\n    {\n        var request = new Request(message.Property);\n        var response = await context.InvokeAsync\u003cResponse\u003e(request);\n        Trace.WriteLine(response.Property);\n    }\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/InvokeDelegateUsage.cs#L24-L36' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-InvokeAsyncHandler' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\nThe result can be set:\n\n\u003c!-- snippet: InvokeDelegateTest --\u003e\n\u003ca id='snippet-InvokeDelegateTest'\u003e\u003c/a\u003e\n```cs\n[Fact]\npublic async Task HandlerTest()\n{\n    var context = new RecordingMessageContext();\n    context.AddInvokeResult\u003cResponse\u003e(\n        message =\u003e\n        {\n            var request = (Request) message;\n            return new Response(request.Property);\n        });\n    var handler = new Handler(context);\n    await handler.Handle(new Message(\"value\"));\n    await Verify(context);\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/InvokeDelegateUsage.cs#L5-L22' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-InvokeDelegateTest' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Icon\n\n[Wolverine](https://thenounproject.com/term/wolverine/3386573/) designed by [Phạm Thanh Lộc](https://thenounproject.com/thanhloc1009/) from [The Noun Project](https://thenounproject.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Fverify.wolverine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverifytests%2Fverify.wolverine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Fverify.wolverine/lists"}