# Plugins Verify can be extended using plugins that are shipped as nuget packages. ## Extension points Plugins usually manipulate a subset of the extension points of Verify. * [Comparers](comparer.md) for comparing non-text files. * [Converters](converter.md) to split a target into its component parts, then verify each of those parts. * [Serializer settings](serializer-settings.md) * [Ordering](ordering.md) * [Scrubbers](scrubbers.md) ## Enabling Plugins Plugins can have static config and/or instance based APIs ### Static config Static APIs are enabled in a ModuleInitializer of the consuming test project. For example in [Verify.Http](https://github.com/VerifyTests/Verify.Http) the method `VerifyHttp.Initialize()` is called: ``` public static class ModuleInitializer { [ModuleInitializer] public static void Initialize() => VerifyHttp.Initialize(); } ``` ### Automatic plugin detection There is a convenience API for initializing all plugins: `VerifierSettings.InitializePlugins()` This API performs the following * Scans the current assembly's directory for plugin assemblies matching `Verify.*.dll` * Loads each assembly * Try to find the type `VerifyTests.[AssemblyNameWithPeriodsRemove]` * If no type exists move to the next assembly. * If the `Initialized` property (`public static bool Initialized { get; }`) is true then move to the next assembly. An exception is thrown if no `Initialized` property is found. * Invoke the `Initialize` method (`public static void Initialize()`) on that type. An exception is thrown if no `Initialize` method is found. Optional parameters are supported. The plugins `Initialize` method should throw if already Initialized and set `Initialized` to `true`: ``` public static void Initialize() { if (Initialized) { throw new("Already Initialized"); } Initialized = true; ``` `VerifierSettings.InitializePlugins` is called in a ModuleInitializer of the consuming test project: ``` public static class ModuleInitializer { [ModuleInitializer] public static void Initialize() => VerifierSettings.InitializePlugins(); } ``` #### Combining specific config with automatic config In some scenarios it may be necessary to explicitly call Initialize for some plugins. For example when order is important, or a certain plugin has some parameters on Initialize. In this case the specific plugin(s) Initialize methods can be called, then InitializePlugins can be call. ``` public static class ModuleInitializer { [ModuleInitializer] public static void Initialize() { VerifyNServiceBus.Initialize(captureLogs: true); VerifierSettings.InitializePlugins(); } } ``` ## Existing Plugins * [Verify.AngleSharp](https://github.com/VerifyTests/Verify.AngleSharp): Html verification utilities via [AngleSharp](https://github.com/AngleSharp/AngleSharp). * [Verify.AspNetCore](https://github.com/VerifyTests/Verify.AspNetCore): Verification of AspNetCore bits. * [Verify.Aspose](https://github.com/VerifyTests/Verify.Aspose): Verification of documents (pdf, docx, xlsx, and pptx) via Aspose. * [Verify.Assertions](https://github.com/VerifyTests/Verify.Assertions): Extends Verify to allow an assertion callback. This enables using assertion libraries to interrogate during serialization. * [Verify.AustralianProtectiveMarkings](https://github.com/pmcau/AustralianProtectiveMarkings): Verification of AustralianProtectiveMarkings. * [Verify.Avalonia](https://github.com/VerifyTests/Verify.Avalonia): Verification of [Avalonia UIs](https://avaloniaui.net/). * [Verify.Blazor](https://github.com/VerifyTests/Verify.Blazor): Verification of [Blazor Component](https://docs.microsoft.com/en-us/aspnet/core/blazor/#components) Blazor rendering. * [Verify.Bunit](https://github.com/VerifyTests/Verify.Bunit): Verification of [Blazor Component](https://docs.microsoft.com/en-us/aspnet/core/blazor/#components) via [bunit](https://bunit.egilhansen.com). * [Verify.Brighter](https://github.com/VerifyTests/Verify.Brighter): Verification of [Brighter](https://www.goparamore.io/) bits. * [Verify.Cli](https://github.com/flcdrg/Verify.Cli): Command line tool for verifying files (outside of unit tests). * [Verify.CommunityToolkit.Mvvm](https://github.com/VerifyTests/Verify.CommunityToolkit.Mvvm): Verification of [CommunityToolkit.Mvvm](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/). * [Verify.Cosmos](https://github.com/VerifyTests/Verify.Cosmos): Verification of [Azure CosmosDB](https://docs.microsoft.com/en-us/azure/cosmos-db/). * [Verify.ClosedXml](https://github.com/VerifyTests/Verify.ClosedXml): Verification of Excel documents via [ClosedXml](https://github.com/ClosedXML/ClosedXML). * [Verify.CsvHelper](https://github.com/VerifyTests/Verify.CsvHelper): Verification of CSVs via [CsvHelper](https://joshclose.github.io/CsvHelper/). * [Verify.DiffPlex](https://github.com/VerifyTests/Verify.DiffPlex): Comparison of text via [DiffPlex](https://github.com/mmanela/diffplex). * [Verify.DocNet](https://github.com/VerifyTests/Verify.DocNet): Verification of pdfs via [DocNet](https://github.com/GowenGit/docnet). * [Verify.EntityFramework](https://github.com/VerifyTests/Verify.EntityFramework): Verification of EntityFramework bits. * [Verify.FakeItEasy](https://github.com/VerifyTests/Verify.FakeItEasy): Verification of [FakeItEasy](https://fakeiteasy.github.io/) bits. * [Verify.Flurl](https://github.com/VerifyTests/Verify.Flurl): Verification of [Flurl](https://flurl.dev/) bits. * [Verify.HeadlessBrowsers](https://github.com/VerifyTests/Verify.HeadlessBrowsers): Verification of Web UIs using [Playwright](https://github.com/microsoft/playwright-sharp), [Puppeteer Sharp](https://github.com/hardkoded/puppeteer-sharp), or [Selenium](https://www.selenium.dev). * [Verify.Http](https://github.com/VerifyTests/Verify.Http): Verification of Http bits. * [Verify.ICSharpCode.Decompiler](https://github.com/VerifyTests/Verify.ICSharpCode.Decompiler): Comparison of assemblies and types via [ICSharpCode.Decompiler](https://github.com/icsharpcode/ILSpy/wiki/Getting-Started-With-ICSharpCode.Decompiler). * [Verify.ImageHash](https://github.com/VerifyTests/Verify.ImageHash): Comparison of images via [ImageHash](https://github.com/coenm/ImageHash). * [Verify.ImageSharp.Compare](https://github.com/VerifyTests/Verify.ImageSharp.Compare): Verification and comparison of images via [Codeuctivity.ImageSharp.Compare](https://github.com/Codeuctivity/ImageSharp.Compare). * [Verify.ImageMagick](https://github.com/VerifyTests/Verify.ImageMagick): Verification and comparison of images via [Magick.NET](https://github.com/dlemstra/Magick.NET). * [Verify.ImageSharp](https://github.com/VerifyTests/Verify.ImageSharp): Verification of images via [ImageSharp](https://github.com/SixLabors/ImageSharp). * [Verify.TestableIO.System.IO.Abstractions](https://github.com/VerifyTests/Verify.TestableIO.System.IO.Abstractions): Verification of [TestableIO.System.IO.Abstractions](https://github.com/TestableIO/System.IO.Abstractions). * [Verify.MailMessage](https://github.com/VerifyTests/Verify.MailMessage): Verification of [MailMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.mailmessage) and related types. * [YellowDogMan.Verify.Marshaling](https://github.com/Yellow-Dog-Man/Verify.Marshaling): Verification of [Struct Marshaling](https://learn.microsoft.com/en-us/dotnet/standard/native-interop/customize-struct-marshalling). * [Verify.MassTransit](https://github.com/VerifyTests/Verify.MassTransit): Support for MassTransit test helpers. * [Verify.MicrosoftLogging](https://github.com/VerifyTests/Verify.MicrosoftLogging): Verify MicrosoftLogging. * [Verify.MongoDB](https://github.com/flcdrg/Verify.MongoDB): Verification of [MongoDB](https://www.mongodb.com/) bits. * [Verify.Moq](https://github.com/VerifyTests/Verify.Moq): Verification of [Moq](https://github.com/moq/moq4) bits. * [Verify.NodaTime](https://github.com/VerifyTests/Verify.NodaTime): Support for [NodaTime](https://nodatime.org/). * [Verify.NewtonsoftJson](https://github.com/VerifyTests/Verify.NewtonsoftJson): Support for converting [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) types (JObject and JArray). * [Verify.NServiceBus](https://github.com/VerifyTests/Verify.NServiceBus): Verify NServiceBus Test Contexts. * [Verify.NSubstitute](https://github.com/VerifyTests/Verify.NSubstitute): Support for [NSubstitute](https://nsubstitute.github.io/) types. * [Verify.Nupkg](https://github.com/MattKotsenas/Verify.Nupkg/): Verification of [NuGet .nupkg](https://learn.microsoft.com/en-us/nuget/what-is-nuget) files. * [Verify.Pandoc](https://github.com/VerifyTests/Verify.Pandoc): Verification of documents via [PandocNet](https://github.com/SimonCropp/PandocNet). * [Verify.PdfPig](https://github.com/VerifyTests/Verify.PdfPig): Verification of pdfs via [PdfPig](https://github.com/UglyToad/PdfPig). * [Verify.ParametersHashing](https://github.com/VerifyTests/Verify.ParametersHashing): Extends Verify to allow hashing of parameters to mitigate long file names. * [Verify.Phash](https://github.com/VerifyTests/Verify.Phash): Comparison of images via [Phash](https://github.com/pgrho/phash). * [Verify.Quibble](https://github.com/VerifyTests/Verify.Quibble): Comparison of objects via [Quibble](https://github.com/nrkno/Quibble). * [Verify.QuestPDF](https://github.com/VerifyTests/Verify.QuestPDF): Verification of pdf documents via [QuestPDF](https://www.questpdf.com/). * [Verify.RavenDb](https://github.com/VerifyTests/Verify.RavenDb): Verification of [RavenDb](https://ravendb.net) bits. * [Verify.SendGrid](https://github.com/VerifyTests/Verify.SendGrid): Verification of [SendGrid](https://github.com/sendgrid/sendgrid-csharp). * [Verify.Sep](https://github.com/VerifyTests/Verify.Sep): Verification of CSVs via [Sep](https://github.com/nietras/Sep) bits. * [Verify.Serilog](https://github.com/VerifyTests/Verify.Serilog): Verification of [Serilog](https://serilog.net/) bits. * [YellowDogMan.Verify.ssimulacra2](https://github.com/Yellow-Dog-Man/Verify.ssimulacra2): Verification and comparison of images via [ssimulacra2](https://github.com/cloudinary/ssimulacra2). * [Verify.SqlServer](https://github.com/VerifyTests/Verify.SqlServer): Verification of SqlServer bits. * [Verify.SourceGenerators](https://github.com/VerifyTests/Verify.SourceGenerators): Verification of C# Source Generators. * [Verify.SystemJson](https://github.com/VerifyTests/Verify.SystemJson): Support for converting System.Text.Json types. * [Verify.Terminal](https://github.com/VerifyTests/Verify.Terminal): A dotnet tool for managing Verify snapshots. * [Verify.Ulid](https://github.com/VerifyTests/Verify.Ulid): Enable scrubbing of Universally Unique Lexicographically Sortable Identifiers via the [Ulid](https://github.com/Cysharp/Ulid) package. * [Verify.NUlid](https://github.com/VerifyTests/Verify.NUlid): Enable scrubbing of Universally Unique Lexicographically Sortable Identifiers via [NUlid](https://github.com/RobThree/NUlid) package. * [Verify.WinForms](https://github.com/VerifyTests/Verify.WinForms): Verification of WinForms UIs. * [Verify.Xamarin](https://github.com/VerifyTests/Verify.Xamarin): Verification of Xamarin UIs. * [Verify.Xaml](https://github.com/VerifyTests/Verify.Xaml): Verification of Xaml UIs. * [Spectre.Verify.Extensions](https://github.com/spectresystems/spectre.verify.extensions): Add an attribute driven file naming convention to Verify. * [Verify.Sylvan.Data.Excel](https://github.com/VerifyTests/Verify.Sylvan.Data.Excel): Verification of Excel documents via [Sylvan.Data.Excel](https://github.com/MarkPflug/Sylvan.Data.Excel/). * [Verify.Syncfusion](https://github.com/VerifyTests/Verify.Syncfusion): Verification of documents (pdf, docx, xlsx, and pptx) via [Syncfusion File Formats](https://help.syncfusion.com/file-formats/introduction). * [Verify.Wolverine](https://github.com/VerifyTests/Verify.Wolverine):Verifiable test context for [Wolverine](https://github.com/JasperFx/wolverine). * [Verify.Yaml](https://github.com/VerifyTests/Verify.Yaml): Support for [YamlDotNet](https://github.com/aaubry/YamlDotNet) types. * [Verify.ZeroLog](https://github.com/VerifyTests/Verify.ZeroLog): Verifiable test context for [ZeroLog](https://github.com/Abc-Arbitrage/ZeroLog).