diff --git a/src/ModuleInitDocs/OnHandlers.cs b/src/ModuleInitDocs/OnHandlers.cs new file mode 100644 index 0000000000..689cfa9556 --- /dev/null +++ b/src/ModuleInitDocs/OnHandlers.cs @@ -0,0 +1,32 @@ +public class OnHandlers +{ + #region OnHandlers + + public static class ModuleInitializer + { + [ModuleInitializer] + public static void Init() + { + VerifierSettings.OnVerify( + before: () => Debug.WriteLine("before"), + after: () => Debug.WriteLine("after")); + VerifierSettings.OnFirstVerify( + (receivedFile, receivedText) => + { + Debug.WriteLine(receivedFile); + Debug.WriteLine(receivedText); + return Task.CompletedTask; + }); + VerifierSettings.OnVerifyMismatch( + (filePair, message) => + { + Debug.WriteLine(filePair.ReceivedPath); + Debug.WriteLine(filePair.VerifiedPath); + Debug.WriteLine(message); + return Task.CompletedTask; + }); + } + } + + #endregion +} \ No newline at end of file diff --git a/src/Verify.Tests/Snippets/Snippets.cs b/src/Verify.Tests/Snippets/Snippets.cs index 904a125922..95e8545d8e 100644 --- a/src/Verify.Tests/Snippets/Snippets.cs +++ b/src/Verify.Tests/Snippets/Snippets.cs @@ -34,32 +34,6 @@ void EnableClipboard() #endregion } - #region OnHandlers - - public Task OnHandlersSample() - { - VerifierSettings.OnVerify( - before: () => Debug.WriteLine("before"), - after: () => Debug.WriteLine("after")); - VerifierSettings.OnFirstVerify( - (receivedFile, receivedText) => - { - Debug.WriteLine(receivedFile); - return Task.CompletedTask; - }); - VerifierSettings.OnVerifyMismatch( - (filePair, message) => - { - Debug.WriteLine(filePair.ReceivedPath); - Debug.WriteLine(filePair.VerifiedPath); - Debug.WriteLine(message); - return Task.CompletedTask; - }); - return Verify("value"); - } - - #endregion - void TreatAsString() { #region TreatAsString