From e0c0dae60f20ed8736a9b902c2c03991216f23ad Mon Sep 17 00:00:00 2001 From: Timothy Makkison Date: Thu, 10 Oct 2024 18:47:48 +0100 Subject: [PATCH] chore: upgrade `Verify.SourceGenerators` and update tests --- .../Refit.GeneratorTests.csproj | 2 +- ...itMethodShouldRaiseDiagnostic.verified.txt | 22 ++++++++++++++----- ...MethodsWithGenericConstraints.verified.txt | 22 ++++++++++++++----- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Refit.GeneratorTests/Refit.GeneratorTests.csproj b/Refit.GeneratorTests/Refit.GeneratorTests.csproj index 2bec2fc96..252c629a5 100644 --- a/Refit.GeneratorTests/Refit.GeneratorTests.csproj +++ b/Refit.GeneratorTests/Refit.GeneratorTests.csproj @@ -20,7 +20,7 @@ - + diff --git a/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic.verified.txt b/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic.verified.txt index 9bc7316a4..23b3467ce 100644 --- a/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic.verified.txt +++ b/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RF001, - Title: Refit types must have Refit HTTP method attributes, + Location: /* + +void NonRefitMethod(); + ^^^^^^^^^^^^^^ +} +*/ + : (16,5)-(16,19), + Message: Method IGeneratedClient.NonRefitMethod either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, Severity: Warning, WarningLevel: 1, - Location: : (16,5)-(16,19), - MessageFormat: Method {0}.{1} either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, - Message: Method IGeneratedClient.NonRefitMethod either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, - Category: Refit + Descriptor: { + Id: RF001, + Title: Refit types must have Refit HTTP method attributes, + MessageFormat: Method {0}.{1} either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, + Category: Refit, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints.verified.txt b/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints.verified.txt index 37eceea43..171090020 100644 --- a/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints.verified.txt +++ b/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RF001, - Title: Refit types must have Refit HTTP method attributes, + Location: /* + +void NonRefitMethod() + ^^^^^^^^^^^^^^ + where T1 : class +*/ + : (21,5)-(21,19), + Message: Method IGeneratedClient.NonRefitMethod either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, Severity: Warning, WarningLevel: 1, - Location: : (21,5)-(21,19), - MessageFormat: Method {0}.{1} either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, - Message: Method IGeneratedClient.NonRefitMethod either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, - Category: Refit + Descriptor: { + Id: RF001, + Title: Refit types must have Refit HTTP method attributes, + MessageFormat: Method {0}.{1} either has no Refit HTTP method attribute or you've used something other than a string literal for the 'path' argument, + Category: Refit, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file