diff --git a/README.md b/README.md
index 9c4dabb..4ddedaf 100644
--- a/README.md
+++ b/README.md
@@ -264,4 +264,17 @@ public class Service
private bool IsValid() => throw new NotImplementedException();
}
+```
+
+## Configuration
+|Property|Default|Description|
+|--|--|--|
+|UnionTypesGenerator_ExcludeFromCodeCoverage|true|Add [ExcludeFromCodeCoverage]([https://](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=net-8.0)) attribute when `true`|
+
+```xml
+
+
+ false
+
+
```
\ No newline at end of file
diff --git a/examples/BusinessLogic/BusinessLogic.csproj b/examples/BusinessLogic/BusinessLogic.csproj
index 5ca2a0d..d05a052 100644
--- a/examples/BusinessLogic/BusinessLogic.csproj
+++ b/examples/BusinessLogic/BusinessLogic.csproj
@@ -1,4 +1,7 @@
+
+ false
+
diff --git a/src/N.SourceGenerators.UnionTypes/Extensions/SyntaxNodeExtensions.cs b/src/N.SourceGenerators.UnionTypes/Extensions/SyntaxNodeExtensions.cs
index b9546d1..36d2161 100644
--- a/src/N.SourceGenerators.UnionTypes/Extensions/SyntaxNodeExtensions.cs
+++ b/src/N.SourceGenerators.UnionTypes/Extensions/SyntaxNodeExtensions.cs
@@ -1,4 +1,6 @@
-namespace N.SourceGenerators.UnionTypes.Extensions;
+using N.SourceGenerators.UnionTypes.Models;
+
+namespace N.SourceGenerators.UnionTypes.Extensions;
internal static class SyntaxNodeExtensions
{
@@ -9,7 +11,7 @@ public static bool IsTypeWithAttributes(this SyntaxNode s)
AttributeLists.Count: > 0
};
}
-
+
public static bool IsGenericTypeAttribute(this SyntaxNode s)
{
if (s is not TypeParameterSyntax typeParameter)
@@ -29,7 +31,7 @@ public static bool IsPartial(this TypeDeclarationSyntax s)
{
return s.Modifiers.Any(SyntaxKind.PartialKeyword);
}
-
+
public static AwaitExpressionSyntax AwaitWithConfigureAwait(this ExpressionSyntax expression)
{
return AwaitExpression(
@@ -44,4 +46,21 @@ public static AwaitExpressionSyntax AwaitWithConfigureAwait(this ExpressionSynta
)
);
}
+
+ public static TSyntax ExcludeFromCodeCoverage(this TSyntax node, GeneratorOptions options)
+ where TSyntax : BaseTypeDeclarationSyntax
+ {
+ if (!options.ExcludeFromCodeCoverage)
+ {
+ return node;
+ }
+
+ AttributeListSyntax attributeList = AttributeList()
+ .AddAttributes(
+ Attribute(IdentifierName("System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage"))
+ );
+
+
+ return (TSyntax)node.AddAttributeLists(attributeList);
+ }
}
\ No newline at end of file
diff --git a/src/N.SourceGenerators.UnionTypes/Models/CompilationContext.cs b/src/N.SourceGenerators.UnionTypes/Models/CompilationContext.cs
deleted file mode 100644
index edb63f5..0000000
--- a/src/N.SourceGenerators.UnionTypes/Models/CompilationContext.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace N.SourceGenerators.UnionTypes.Models;
-
-internal record CompilationContext(
- bool SupportsNotNullWhenAttribute,
- bool SupportsThrowIfNull,
- bool NullableContextEnabled,
- bool SupportsAutoDefaultField);
\ No newline at end of file
diff --git a/src/N.SourceGenerators.UnionTypes/Models/GeneratorContext.cs b/src/N.SourceGenerators.UnionTypes/Models/GeneratorContext.cs
new file mode 100644
index 0000000..ce45164
--- /dev/null
+++ b/src/N.SourceGenerators.UnionTypes/Models/GeneratorContext.cs
@@ -0,0 +1,11 @@
+namespace N.SourceGenerators.UnionTypes.Models;
+
+internal record GeneratorContext(CompilationContext Compilation, GeneratorOptions Options);
+
+internal record CompilationContext(
+ bool SupportsNotNullWhenAttribute,
+ bool SupportsThrowIfNull,
+ bool NullableContextEnabled,
+ bool SupportsAutoDefaultField);
+
+internal record GeneratorOptions(bool ExcludeFromCodeCoverage);
\ No newline at end of file
diff --git a/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.csproj b/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.csproj
index f2a0175..33cc708 100644
--- a/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.csproj
+++ b/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.csproj
@@ -10,7 +10,7 @@
true
true
./nupkg
- 0.27.0
+ 0.28.0
true
$(NoWarn);NU5128
@@ -25,6 +25,10 @@
Discriminated union type source generator
README.md
+
+
+ true
+
@@ -33,6 +37,9 @@
+
+
+
diff --git a/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.props b/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.props
new file mode 100644
index 0000000..fed9bed
--- /dev/null
+++ b/src/N.SourceGenerators.UnionTypes/N.SourceGenerators.UnionTypes.props
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Attributes.cs b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Attributes.cs
index d3350ef..2078704 100644
--- a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Attributes.cs
+++ b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Attributes.cs
@@ -24,6 +24,7 @@ public partial class UnionTypesGenerator
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
@@ -65,6 +66,7 @@ public UnionTypeAttribute(Type type, string alias = null, [CallerLineNumber] int
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
@@ -91,6 +93,7 @@ internal sealed class GenericUnionTypeAttribute : Attribute
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
@@ -113,6 +116,7 @@ internal sealed class JsonPolymorphicUnionAttribute : Attribute
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
@@ -136,6 +140,7 @@ public UnionConverterFromAttribute(Type fromType)
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
@@ -158,6 +163,7 @@ public UnionConverterToAttribute(Type toType)
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Converters.cs b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Converters.cs
index 6d38a5c..d7ab7b2 100644
--- a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Converters.cs
+++ b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Converters.cs
@@ -9,30 +9,30 @@ namespace N.SourceGenerators.UnionTypes;
public sealed partial class UnionTypesGenerator
{
private static void GenerateConverters(IncrementalGeneratorInitializationContext context,
- IncrementalValueProvider compilationContextProvider)
+ IncrementalValueProvider generatorContextProvider)
{
var toConverters = GetUnionConverters(
context,
UnionConverterToAttributeName,
(containerType, otherTypes) => new UnionToConverter(containerType, otherTypes));
- ProcessConverters(context, toConverters, compilationContextProvider);
+ ProcessConverters(context, toConverters, generatorContextProvider);
var fromConverters = GetUnionConverters(
context,
UnionConverterFromAttributeName,
(containerType, otherTypes) => new UnionFromConverter(containerType, otherTypes));
- ProcessConverters(context, fromConverters, compilationContextProvider);
+ ProcessConverters(context, fromConverters, generatorContextProvider);
var unionConverters = GetUnionConverters(context);
- ProcessConverters(context, unionConverters, compilationContextProvider);
+ ProcessConverters(context, unionConverters, generatorContextProvider);
}
private static void ProcessConverters(
IncrementalGeneratorInitializationContext context,
IncrementalValuesProvider unionConverters,
- IncrementalValueProvider compilationContextProvider)
+ IncrementalValueProvider generatorContextProvider)
{
- var combination = unionConverters.Combine(compilationContextProvider);
+ var combination = unionConverters.Combine(generatorContextProvider);
context.RegisterImplementationSourceOutput(
combination,
@@ -81,7 +81,7 @@ private static void ProcessConverters(
if (saveSource)
{
- CompilationUnitSyntax compilationUnit = GetCompilationUnit(typeDeclaration, unionConverter.Namespace, item.Right);
+ CompilationUnitSyntax compilationUnit = GetCompilationUnit(typeDeclaration, unionConverter.Namespace, item.Right.Compilation);
ctx.AddSource($"{unionConverter.Name}Converters.g.cs", compilationUnit.GetText(Encoding.UTF8));
}
});
@@ -173,10 +173,10 @@ private static IncrementalValuesProvider GetUnionConverters(
private static void ProcessConverters(IncrementalGeneratorInitializationContext context,
IncrementalValuesProvider fromConverters,
- IncrementalValueProvider compilationContextProvider)
+ IncrementalValueProvider generatorContextProvider)
where T : IUnionConverter
{
- var combination = fromConverters.Combine(compilationContextProvider);
+ var combination = fromConverters.Combine(generatorContextProvider);
context.RegisterImplementationSourceOutput(
combination,
@@ -210,7 +210,7 @@ private static void ProcessConverters(IncrementalGeneratorInitializationConte
if (saveSource)
{
CompilationUnitSyntax compilationUnit =
- GetCompilationUnit(typeDeclaration, containerType.Namespace, item.Right);
+ GetCompilationUnit(typeDeclaration, containerType.Namespace, item.Right.Compilation);
ctx.AddSource(unionConverter.SourceHintName, compilationUnit.GetText(Encoding.UTF8));
}
});
diff --git a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Json.cs b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Json.cs
index 3136185..8a2f3b0 100644
--- a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Json.cs
+++ b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.Json.cs
@@ -8,16 +8,16 @@ namespace N.SourceGenerators.UnionTypes;
public sealed partial class UnionTypesGenerator
{
private static void GenerateJsonConverter(UnionType unionType,
- SourceProductionContext context,
- CompilationContext compilationContext)
+ SourceProductionContext context,
+ GeneratorContext generatorContext)
{
context.CancellationToken.ThrowIfCancellationRequested();
- BuildJsonConverter(unionType, context, compilationContext);
+ BuildJsonConverter(unionType, context, generatorContext);
context.CancellationToken.ThrowIfCancellationRequested();
- BuildJsonConverterAttribute(unionType, context, compilationContext);
+ BuildJsonConverterAttribute(unionType, context, generatorContext);
}
- private static void BuildJsonConverter(UnionType unionType, SourceProductionContext context, CompilationContext compilationContext)
+ private static void BuildJsonConverter(UnionType unionType, SourceProductionContext context, GeneratorContext generatorContext)
{
TypeDeclarationSyntax converterDeclaration = ClassDeclaration(unionType.Name + "JsonConverter")
.AddModifiers(Token(SyntaxKind.InternalKeyword))
@@ -26,6 +26,7 @@ private static void BuildJsonConverter(UnionType unionType, SourceProductionCont
GenericType("System.Text.Json.Serialization.JsonConverter", unionType.Name)
)
)
+ .ExcludeFromCodeCoverage(generatorContext.Options)
.AddMembers(
GetDiscriminatorMethod(unionType),
AddDiscriminatorModifier(unionType),
@@ -34,11 +35,11 @@ private static void BuildJsonConverter(UnionType unionType, SourceProductionCont
WriteJsonConverterMethod(unionType)
);
- CompilationUnitSyntax compilationUnit = GetCompilationUnit(converterDeclaration, unionType.Namespace, compilationContext);
+ CompilationUnitSyntax compilationUnit = GetCompilationUnit(converterDeclaration, unionType.Namespace, generatorContext.Compilation);
context.AddSource($"{unionType.SourceCodeFileName}JsonConverter.g.cs", compilationUnit.GetText(Encoding.UTF8));
}
- private static void BuildJsonConverterAttribute(UnionType unionType, SourceProductionContext context, CompilationContext compilationContext)
+ private static void BuildJsonConverterAttribute(UnionType unionType, SourceProductionContext context, GeneratorContext generatorContext)
{
TypeDeclarationSyntax converterDeclaration = ClassDeclaration(unionType.Name + "JsonConverterAttribute")
.AddModifiers(
@@ -48,6 +49,7 @@ private static void BuildJsonConverterAttribute(UnionType unionType, SourceProdu
IdentifierName("System.Text.Json.Serialization.JsonConverterAttribute")
)
)
+ .ExcludeFromCodeCoverage(generatorContext.Options)
.AddMembers(
MethodDeclaration(
NullableType(IdentifierName("System.Text.Json.Serialization.JsonConverter")),
@@ -67,7 +69,7 @@ private static void BuildJsonConverterAttribute(UnionType unionType, SourceProdu
)
);
- CompilationUnitSyntax compilationUnit = GetCompilationUnit(converterDeclaration, unionType.Namespace, compilationContext);
+ CompilationUnitSyntax compilationUnit = GetCompilationUnit(converterDeclaration, unionType.Namespace, generatorContext.Compilation);
context.AddSource($"{unionType.SourceCodeFileName}JsonConverterAttribute.g.cs",
compilationUnit.GetText(Encoding.UTF8));
}
diff --git a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.cs b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.cs
index 8f4bba0..2d85af8 100644
--- a/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.cs
+++ b/src/N.SourceGenerators.UnionTypes/UnionTypesGenerator.cs
@@ -19,10 +19,25 @@ public sealed partial class UnionTypesGenerator : IIncrementalGenerator
//
""";
+ public const string ExcludeFromCodeCoverageOption = "build_property.UnionTypesGenerator_ExcludeFromCodeCoverage";
+
public void Initialize(IncrementalGeneratorInitializationContext context)
{
AddAttributesSource(context);
-
+
+ var generatorOptionsProvider = context.AnalyzerConfigOptionsProvider.Select((options, ct) =>
+ {
+ ct.ThrowIfCancellationRequested();
+ bool excludeFromCodeCoverage = true;
+ if (options.GlobalOptions.TryGetValue(ExcludeFromCodeCoverageOption, out var optionValue)
+ && optionValue.Equals("false", StringComparison.OrdinalIgnoreCase))
+ {
+ excludeFromCodeCoverage = false;
+ }
+
+ return new GeneratorOptions(excludeFromCodeCoverage);
+ });
+
var compilationContextProvider = context.CompilationProvider.Select((compilation, ct) =>
{
ct.ThrowIfCancellationRequested();
@@ -36,6 +51,9 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
return compilationContext;
});
+ var generatorContextProvider = generatorOptionsProvider.Combine(compilationContextProvider)
+ .Select((a, ct) => new GeneratorContext(a.Right, a.Left));
+
var unionTypes = GetUnionTypes(context);
var genericUnionTypes = GetGenericUnionTypes(context);
@@ -45,20 +63,20 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
.SelectMany(ProcessCollections);
var unionTypeDiagnostics = GetUnionTypeDiagnostics(uniqueUnionTypes);
- ProcessValues(context, compilationContextProvider, unionTypeDiagnostics, GenerateUnionType);
+ ProcessValues(context, generatorContextProvider, unionTypeDiagnostics, GenerateUnionType);
var jsonTypes = unionTypeDiagnostics
.Where(vd => vd.Diagnostics.Count == 0)
.Where(vd => vd.Value.GenerateJsonConverter);
- var jsonTypesCombination = jsonTypes.Combine(compilationContextProvider);
+ var jsonTypesCombination = jsonTypes.Combine(generatorContextProvider);
// TODO test System.Text.Json is available, add diagnostics
context.RegisterImplementationSourceOutput(
jsonTypesCombination,
(ctx, item) => { GenerateJsonConverter(item.Left.Value, ctx, item.Right); });
- GenerateConverters(context, compilationContextProvider);
+ GenerateConverters(context, generatorContextProvider);
}
private IEnumerable ProcessCollections(
@@ -235,10 +253,11 @@ bool GetAllowNullValue(AttributeData attribute)
}
static void GenerateUnionType(UnionType unionType,
- CompilationContext compilationContext,
+ GeneratorContext generatorContext,
SourceProductionContext context)
{
context.CancellationToken.ThrowIfCancellationRequested();
+ CompilationContext compilationContext = generatorContext.Compilation;
TypeDeclarationSyntax typeDeclaration = unionType.IsReferenceType
? ClassDeclaration(unionType.Name)
@@ -247,6 +266,7 @@ static void GenerateUnionType(UnionType unionType,
typeDeclaration = typeDeclaration
.AddAttributeLists(GetTypeAttributes(unionType))
.AddModifiers(Token(SyntaxKind.PartialKeyword))
+ .ExcludeFromCodeCoverage(generatorContext.Options)
.AddMembers(VariantIdField(unionType.UseStructLayout))
.AddMembers(VariantsMembers(unionType, compilationContext))
.AddMembers(
@@ -282,9 +302,9 @@ static void GenerateUnionType(UnionType unionType,
}
private static CompilationUnitSyntax GetCompilationUnit(TypeDeclarationSyntax typeDeclaration,
- string? typeNamespace, CompilationContext compilationContext)
+ string? typeNamespace, CompilationContext context)
{
- SyntaxTriviaList syntaxTriviaList = GetTriviaList(compilationContext);
+ SyntaxTriviaList syntaxTriviaList = GetTriviaList(context);
CompilationUnitSyntax compilationUnit;
if (typeNamespace is null)
@@ -310,17 +330,17 @@ private static CompilationUnitSyntax GetCompilationUnit(TypeDeclarationSyntax ty
private static SyntaxTriviaList GetTriviaList(CompilationContext compilationContext)
{
return TriviaList(
- Comment(AutoGeneratedComment),
- Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true)))
+ Comment(AutoGeneratedComment),
+ Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true)))
.AddWhen(
- compilationContext.NullableContextEnabled,
+ compilationContext.NullableContextEnabled,
Trivia(NullableDirectiveTrivia(Token(SyntaxKind.EnableKeyword), true)));
}
private static void ProcessValues(IncrementalGeneratorInitializationContext context,
- IncrementalValueProvider compilationContextProvider,
+ IncrementalValueProvider compilationContextProvider,
IncrementalValuesProvider> valueDiagnostics,
- Action processAction)
+ Action processAction)
{
ReportDiagnostics(context, valueDiagnostics);
@@ -334,9 +354,9 @@ private static void ProcessValues(IncrementalGeneratorInitializationContext c
(ctx, item) =>
{
ValueDiagnostics diagnostics = item.Left;
- CompilationContext compilationContext = item.Item2;
+ GeneratorContext generatorContext = item.Item2;
- processAction(diagnostics.Value, compilationContext, ctx);
+ processAction(diagnostics.Value, generatorContext, ctx);
});
}
@@ -558,7 +578,7 @@ private static MemberDeclarationSyntax Ctor(UnionType unionType, UnionTypeVarian
.AddBodyStatementsWhen(!unionType.UseStructLayout && !variant.AllowNull && compilationContext.SupportsThrowIfNull,
ExpressionStatement(checkArgumentExpression))
.AddBodyStatementsWhen(!unionType.UseStructLayout && !variant.AllowNull && !compilationContext.SupportsThrowIfNull,
- checkArgumentLegacy)
+ checkArgumentLegacy)
.AddBodyStatements(
ExpressionStatement(SimpleAssignmentExpression(
VariantIdFieldName,
@@ -567,7 +587,7 @@ private static MemberDeclarationSyntax Ctor(UnionType unionType, UnionTypeVarian
ExpressionStatement(assignmentExpression)
)
.AddBodyStatementsWhen(
- !compilationContext.SupportsAutoDefaultField && unionType.IsValueType,
+ !compilationContext.SupportsAutoDefaultField && unionType.IsValueType,
initOtherVariants.Cast().ToArray());
}
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorAnalyzerConfigOptionsProvider.cs b/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorAnalyzerConfigOptionsProvider.cs
new file mode 100644
index 0000000..e921e0a
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorAnalyzerConfigOptionsProvider.cs
@@ -0,0 +1,24 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Diagnostics;
+
+namespace N.SourceGenerators.UnionTypes.Tests;
+
+public class GeneratorAnalyzerConfigOptionsProvider : AnalyzerConfigOptionsProvider
+{
+ public GeneratorAnalyzerConfigOptionsProvider(AnalyzerConfigOptions? globalOptions)
+ {
+ GlobalOptions = globalOptions ?? UnionTypesAnalyzerConfigOptions.Default;
+ }
+
+ public override AnalyzerConfigOptions GetOptions(SyntaxTree tree)
+ {
+ return UnionTypesAnalyzerConfigOptions.Default;
+ }
+
+ public override AnalyzerConfigOptions GetOptions(AdditionalText textFile)
+ {
+ return UnionTypesAnalyzerConfigOptions.Default;
+ }
+
+ public override AnalyzerConfigOptions GlobalOptions { get; }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorTests.cs b/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorTests.cs
index 63be26c..d973967 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorTests.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/GeneratorTests.cs
@@ -6,10 +6,13 @@ namespace N.SourceGenerators.UnionTypes.Tests;
public class GeneratorTests
{
[Theory]
- [InlineData("partial class")]
- [InlineData("partial struct")]
- [InlineData("readonly partial struct")]
- public Task WithoutNamespace(string typeModifiers)
+ [InlineData("partial class", true)]
+ [InlineData("partial struct", true)]
+ [InlineData("readonly partial struct", true)]
+ [InlineData("partial class", false)]
+ [InlineData("partial struct", false)]
+ [InlineData("readonly partial struct", false)]
+ public Task WithoutNamespace(string typeModifiers, bool excludeCodeCoverage)
{
string source = $$"""
using System;
@@ -28,7 +31,13 @@ public record Wrapped(TItem Item);
}
""";
- return TestHelper.Verify(source, LanguageVersion.Latest, typeModifiers.Replace(' ', '-'));
+ UnionTypesAnalyzerConfigOptions analyzerOptions = new() { ExcludeFromCodeCoverage = excludeCodeCoverage };
+
+ return TestHelper.Verify(
+ source,
+ LanguageVersion.Latest,
+ typeModifiers.Replace(' ', '-') + $"-exclude-{excludeCodeCoverage}",
+ analyzerOptions);
}
[Theory]
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/JsonTests.cs b/tests/N.SourceGenerators.UnionTypes.Tests/JsonTests.cs
index 417d3fe..89c0014 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/JsonTests.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/JsonTests.cs
@@ -38,6 +38,7 @@ public partial class JsonTestsUnion
source,
LanguageVersion.Latest,
null,
+ null,
MetadataReference.CreateFromFile(Assembly.Load(new AssemblyName("System.Runtime")).Location),
MetadataReference.CreateFromFile(Assembly.Load(new AssemblyName("System.Text.Json")).Location),
MetadataReference.CreateFromFile(Assembly.Load(new AssemblyName("System.Text.Encodings.Web")).Location)
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#BusinessLogicResult.g.verified.cs
index 9deaf48..ae7fcfd 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverter#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
index 469be40..e6b0955 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#BusinessLogicResult.g.verified.cs
index 9deaf48..ae7fcfd 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverter#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
index 469be40..e6b0955 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.FromConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#BusinessLogicResult.g.verified.cs
index 9deaf48..ae7fcfd 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverter#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
index 469be40..e6b0955 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.StaticExternalConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#BusinessLogicResult.g.verified.cs
index 9deaf48..ae7fcfd 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverter#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
index 373f5b7..7def6e7 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#BusinessLogicResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#DataAccessResult.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#DataAccessResult.g.verified.cs
index 516e30f..f303a5e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#DataAccessResult.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#DataAccessResult.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessResult : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/ConverterGeneratorTests.ToConverterReportsDiagnostic#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.InvalidTypeReportsAllDiagnostics#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.NotPartialTypeReportsDiagnostics#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantAliasDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantOrderDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/DiagnosticTests.VariantTypeDuplicateReportsDiagnostics#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#Result.g.verified.cs
index 0ce6bf1..3c584da 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#Result.g.verified.cs
@@ -6,6 +6,7 @@
#pragma warning disable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-class#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#Result.g.verified.cs
index b301b3c..7a30a26 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#Result.g.verified.cs
@@ -6,6 +6,7 @@
#pragma warning disable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.CSharp73_partial-struct#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#Result.g.verified.cs
index e1f4e61..0c29285 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp.Domain.Child
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DifferentNamespaces#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#Result.g.verified.cs
index 851621a..acc45de 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-class#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#Result.g.verified.cs
index c2f27bf..00850a4 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_partial-struct#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#Result.g.verified.cs
index c2f27bf..00850a4 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.DoNotOverrideToString_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#Result.g.verified.cs
index 9ecb3fd..21aefbe 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#Result.g.verified.cs
@@ -8,6 +8,7 @@
namespace MyApp
{
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
[System.Runtime.InteropServices.FieldOffset(0)]
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.ExplicitStructLayout#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#Result.g.verified.cs
index b6b9945..b524556 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-class#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#Result.g.verified.cs
index cb39346..e1cad04 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_partial-struct#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#Result.g.verified.cs
index cb39346..e1cad04 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#Result.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace MyApp
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial struct Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#GenericUnionTypeAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
similarity index 92%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#Result.g.verified.cs
similarity index 100%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#Result.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#Result.g.verified.cs
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterFromAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterToAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionTypeAttribute.g.verified.cs
similarity index 95%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-False#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#GenericUnionTypeAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
similarity index 92%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#Result.g.verified.cs
new file mode 100644
index 0000000..e15e5f9
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#Result.g.verified.cs
@@ -0,0 +1,311 @@
+//HintName: Result.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#pragma warning disable
+#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+partial class Result : System.IEquatable
+{
+ private readonly int _variantId;
+ private const int SuccessId = 1;
+ private readonly global::Success _success;
+ public bool IsSuccess => _variantId == SuccessId;
+ public global::Success AsSuccess
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return _success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {ValueAlias} not Success.");
+ }
+ }
+
+ public Result(global::Success success)
+ {
+ System.ArgumentNullException.ThrowIfNull(success);
+ _variantId = SuccessId;
+ _success = success;
+ }
+
+ public static implicit operator Result(global::Success success) => new Result(success);
+ public static explicit operator global::Success(Result value)
+ {
+ if (value._variantId == SuccessId)
+ return value._success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {value.ValueAlias} not Success.");
+ }
+
+ public bool TryGetSuccess([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Success value)
+ {
+ if (_variantId == SuccessId)
+ {
+ value = _success;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int ErrorId = 2;
+ private readonly global::Error _error;
+ public bool IsError => _variantId == ErrorId;
+ public global::Error AsError
+ {
+ get
+ {
+ if (_variantId == ErrorId)
+ return _error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {ValueAlias} not Error.");
+ }
+ }
+
+ public Result(global::Error @error)
+ {
+ System.ArgumentNullException.ThrowIfNull(@error);
+ _variantId = ErrorId;
+ _error = @error;
+ }
+
+ public static implicit operator Result(global::Error @error) => new Result(@error);
+ public static explicit operator global::Error(Result value)
+ {
+ if (value._variantId == ErrorId)
+ return value._error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {value.ValueAlias} not Error.");
+ }
+
+ public bool TryGetError([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Error value)
+ {
+ if (_variantId == ErrorId)
+ {
+ value = _error;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int WrappedOfIReadOnlyListOfStringId = 3;
+ private readonly global::Wrapped> _wrappedOfIReadOnlyListOfString;
+ public bool IsWrappedOfIReadOnlyListOfString => _variantId == WrappedOfIReadOnlyListOfStringId;
+ public global::Wrapped> AsWrappedOfIReadOnlyListOfString
+ {
+ get
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+ }
+
+ public Result(global::Wrapped> wrappedOfIReadOnlyListOfString)
+ {
+ System.ArgumentNullException.ThrowIfNull(wrappedOfIReadOnlyListOfString);
+ _variantId = WrappedOfIReadOnlyListOfStringId;
+ _wrappedOfIReadOnlyListOfString = wrappedOfIReadOnlyListOfString;
+ }
+
+ public static implicit operator Result(global::Wrapped> wrappedOfIReadOnlyListOfString) => new Result(wrappedOfIReadOnlyListOfString);
+ public static explicit operator global::Wrapped>(Result value)
+ {
+ if (value._variantId == WrappedOfIReadOnlyListOfStringId)
+ return value._wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {value.ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+
+ public bool TryGetWrappedOfIReadOnlyListOfString([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Wrapped> value)
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ value = _wrappedOfIReadOnlyListOfString;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ public TOut Match(global::System.Func matchSuccess, global::System.Func matchError, global::System.Func>, TOut> matchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ return matchSuccess(_success);
+ if (_variantId == ErrorId)
+ return matchError(_error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task MatchAsync(global::System.Func> matchSuccess, global::System.Func> matchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> matchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ return await matchSuccess(_success, ct).ConfigureAwait(false);
+ if (_variantId == ErrorId)
+ return await matchError(_error, ct).ConfigureAwait(false);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return await matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public void Switch(global::System.Action switchSuccess, global::System.Action switchError, global::System.Action>> switchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ {
+ switchSuccess(_success);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ switchError(_error);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task SwitchAsync(global::System.Func switchSuccess, global::System.Func switchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> switchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ {
+ await switchSuccess(_success, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ await switchError(_error, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ await switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public global::System.Type ValueType
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return typeof(global::Success);
+ if (_variantId == ErrorId)
+ return typeof(global::Error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return typeof(global::Wrapped>);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ private string ValueAlias
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return "Success";
+ if (_variantId == ErrorId)
+ return "Error";
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return "WrappedOfIReadOnlyListOfString";
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ if (_variantId == SuccessId)
+ return _success.GetHashCode();
+ if (_variantId == ErrorId)
+ return _error.GetHashCode();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.GetHashCode();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public static bool operator ==(Result? left, Result? right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Result? left, Result? right)
+ {
+ return !Equals(left, right);
+ }
+
+ public bool Equals(Result? other)
+ {
+ if (ReferenceEquals(null, other))
+ {
+ return false;
+ }
+
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+
+ if (ValueType != other.ValueType)
+ {
+ return false;
+ }
+
+ if (_variantId == SuccessId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_success, other._success);
+ if (_variantId == ErrorId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_error, other._error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return System.Collections.Generic.EqualityComparer>>.Default.Equals(_wrappedOfIReadOnlyListOfString, other._wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override string ToString()
+ {
+ if (_variantId == SuccessId)
+ return _success.ToString();
+ if (_variantId == ErrorId)
+ return _error.ToString();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.ToString();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override bool Equals(object? other)
+ {
+ if (ReferenceEquals(null, other))
+ {
+ return false;
+ }
+
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+
+ if (other.GetType() != typeof(Result))
+ {
+ return false;
+ }
+
+ return Equals((Result)other);
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterFromAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterToAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionTypeAttribute.g.verified.cs
similarity index 95%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class-exclude-True#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
similarity index 92%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#Result.g.verified.cs
similarity index 100%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#Result.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#Result.g.verified.cs
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs
similarity index 93%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs
similarity index 91%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterToAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-class#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs
similarity index 95%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionTypeAttribute.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..29d7087
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs
@@ -0,0 +1,28 @@
+//HintName: GenericUnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class GenericUnionTypeAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object? TypeDiscriminator { get; set; }
+#else
+ public string Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object TypeDiscriminator { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
new file mode 100644
index 0000000..52628cf
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -0,0 +1,24 @@
+//HintName: JsonPolymorphicUnionAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class JsonPolymorphicUnionAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? TypeDiscriminatorPropertyName { get; set; }
+#else
+ public string TypeDiscriminatorPropertyName { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#Result.g.verified.cs
new file mode 100644
index 0000000..5490be7
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#Result.g.verified.cs
@@ -0,0 +1,286 @@
+//HintName: Result.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#pragma warning disable
+#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+partial struct Result : System.IEquatable
+{
+ private readonly int _variantId;
+ private const int SuccessId = 1;
+ private readonly global::Success _success;
+ public bool IsSuccess => _variantId == SuccessId;
+ public global::Success AsSuccess
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return _success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {ValueAlias} not Success.");
+ }
+ }
+
+ public Result(global::Success success)
+ {
+ System.ArgumentNullException.ThrowIfNull(success);
+ _variantId = SuccessId;
+ _success = success;
+ }
+
+ public static implicit operator Result(global::Success success) => new Result(success);
+ public static explicit operator global::Success(Result value)
+ {
+ if (value._variantId == SuccessId)
+ return value._success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {value.ValueAlias} not Success.");
+ }
+
+ public bool TryGetSuccess([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Success value)
+ {
+ if (_variantId == SuccessId)
+ {
+ value = _success;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int ErrorId = 2;
+ private readonly global::Error _error;
+ public bool IsError => _variantId == ErrorId;
+ public global::Error AsError
+ {
+ get
+ {
+ if (_variantId == ErrorId)
+ return _error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {ValueAlias} not Error.");
+ }
+ }
+
+ public Result(global::Error @error)
+ {
+ System.ArgumentNullException.ThrowIfNull(@error);
+ _variantId = ErrorId;
+ _error = @error;
+ }
+
+ public static implicit operator Result(global::Error @error) => new Result(@error);
+ public static explicit operator global::Error(Result value)
+ {
+ if (value._variantId == ErrorId)
+ return value._error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {value.ValueAlias} not Error.");
+ }
+
+ public bool TryGetError([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Error value)
+ {
+ if (_variantId == ErrorId)
+ {
+ value = _error;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int WrappedOfIReadOnlyListOfStringId = 3;
+ private readonly global::Wrapped> _wrappedOfIReadOnlyListOfString;
+ public bool IsWrappedOfIReadOnlyListOfString => _variantId == WrappedOfIReadOnlyListOfStringId;
+ public global::Wrapped> AsWrappedOfIReadOnlyListOfString
+ {
+ get
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+ }
+
+ public Result(global::Wrapped> wrappedOfIReadOnlyListOfString)
+ {
+ System.ArgumentNullException.ThrowIfNull(wrappedOfIReadOnlyListOfString);
+ _variantId = WrappedOfIReadOnlyListOfStringId;
+ _wrappedOfIReadOnlyListOfString = wrappedOfIReadOnlyListOfString;
+ }
+
+ public static implicit operator Result(global::Wrapped> wrappedOfIReadOnlyListOfString) => new Result(wrappedOfIReadOnlyListOfString);
+ public static explicit operator global::Wrapped>(Result value)
+ {
+ if (value._variantId == WrappedOfIReadOnlyListOfStringId)
+ return value._wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {value.ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+
+ public bool TryGetWrappedOfIReadOnlyListOfString([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Wrapped> value)
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ value = _wrappedOfIReadOnlyListOfString;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ public TOut Match(global::System.Func matchSuccess, global::System.Func matchError, global::System.Func>, TOut> matchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ return matchSuccess(_success);
+ if (_variantId == ErrorId)
+ return matchError(_error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task MatchAsync(global::System.Func> matchSuccess, global::System.Func> matchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> matchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ return await matchSuccess(_success, ct).ConfigureAwait(false);
+ if (_variantId == ErrorId)
+ return await matchError(_error, ct).ConfigureAwait(false);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return await matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public void Switch(global::System.Action switchSuccess, global::System.Action switchError, global::System.Action>> switchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ {
+ switchSuccess(_success);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ switchError(_error);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task SwitchAsync(global::System.Func switchSuccess, global::System.Func switchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> switchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ {
+ await switchSuccess(_success, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ await switchError(_error, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ await switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public global::System.Type ValueType
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return typeof(global::Success);
+ if (_variantId == ErrorId)
+ return typeof(global::Error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return typeof(global::Wrapped>);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ private string ValueAlias
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return "Success";
+ if (_variantId == ErrorId)
+ return "Error";
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return "WrappedOfIReadOnlyListOfString";
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ if (_variantId == SuccessId)
+ return _success.GetHashCode();
+ if (_variantId == ErrorId)
+ return _error.GetHashCode();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.GetHashCode();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public static bool operator ==(Result left, Result right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(Result left, Result right)
+ {
+ return !left.Equals(right);
+ }
+
+ public bool Equals(Result other)
+ {
+ if (ValueType != other.ValueType)
+ {
+ return false;
+ }
+
+ if (_variantId == SuccessId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_success, other._success);
+ if (_variantId == ErrorId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_error, other._error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return System.Collections.Generic.EqualityComparer>>.Default.Equals(_wrappedOfIReadOnlyListOfString, other._wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override string ToString()
+ {
+ if (_variantId == SuccessId)
+ return _success.ToString();
+ if (_variantId == ErrorId)
+ return _error.ToString();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.ToString();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override bool Equals(object? obj)
+ {
+ return obj is Result other && Equals(other);
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs
new file mode 100644
index 0000000..3a119c2
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs
@@ -0,0 +1,33 @@
+//HintName: UnionConverterAttribute.g.cs
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterAttribute : Attribute
+ {
+ public Type FromType { get; }
+ public Type ToType { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? MethodName { get; }
+#else
+ public string MethodName { get; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionConverterAttribute(Type fromType, Type toType, string? methodName = null)
+#else
+ public UnionConverterAttribute(Type fromType, Type toType, string methodName = null)
+#endif
+ {
+ FromType = fromType;
+ ToType = toType;
+ MethodName = methodName;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs
new file mode 100644
index 0000000..43174eb
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterFromAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterFromAttribute : Attribute
+ {
+ public Type FromType { get; }
+
+ public UnionConverterFromAttribute(Type fromType)
+ {
+ FromType = fromType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs
new file mode 100644
index 0000000..b72ef9e
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterToAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterToAttribute : Attribute
+ {
+ public Type ToType { get; }
+
+ public UnionConverterToAttribute(Type toType)
+ {
+ ToType = toType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..72e4fc5
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs
@@ -0,0 +1,43 @@
+//HintName: UnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class UnionTypeAttribute : Attribute
+ {
+ public Type Type { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; }
+#else
+ public string Alias { get; }
+#endif
+ public int Order { get; }
+ public bool AllowNull { get; set; }
+#if NETCOREAPP3_1_OR_GREATER
+ public object? TypeDiscriminator { get; set; }
+#else
+ public object TypeDiscriminator { get; set; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionTypeAttribute(Type type, string? alias = null, [CallerLineNumber] int order = 0)
+#else
+ public UnionTypeAttribute(Type type, string alias = null, [CallerLineNumber] int order = 0)
+#endif
+ {
+ Type = type;
+ Alias = alias;
+ Order = order;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..29d7087
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#GenericUnionTypeAttribute.g.verified.cs
@@ -0,0 +1,28 @@
+//HintName: GenericUnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class GenericUnionTypeAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object? TypeDiscriminator { get; set; }
+#else
+ public string Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object TypeDiscriminator { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
new file mode 100644
index 0000000..52628cf
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -0,0 +1,24 @@
+//HintName: JsonPolymorphicUnionAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class JsonPolymorphicUnionAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? TypeDiscriminatorPropertyName { get; set; }
+#else
+ public string TypeDiscriminatorPropertyName { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#Result.g.verified.cs
similarity index 100%
rename from tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct#Result.g.verified.cs
rename to tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#Result.g.verified.cs
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs
new file mode 100644
index 0000000..3a119c2
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterAttribute.g.verified.cs
@@ -0,0 +1,33 @@
+//HintName: UnionConverterAttribute.g.cs
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterAttribute : Attribute
+ {
+ public Type FromType { get; }
+ public Type ToType { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? MethodName { get; }
+#else
+ public string MethodName { get; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionConverterAttribute(Type fromType, Type toType, string? methodName = null)
+#else
+ public UnionConverterAttribute(Type fromType, Type toType, string methodName = null)
+#endif
+ {
+ FromType = fromType;
+ ToType = toType;
+ MethodName = methodName;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs
new file mode 100644
index 0000000..43174eb
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterFromAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterFromAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterFromAttribute : Attribute
+ {
+ public Type FromType { get; }
+
+ public UnionConverterFromAttribute(Type fromType)
+ {
+ FromType = fromType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs
new file mode 100644
index 0000000..b72ef9e
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionConverterToAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterToAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterToAttribute : Attribute
+ {
+ public Type ToType { get; }
+
+ public UnionConverterToAttribute(Type toType)
+ {
+ ToType = toType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..72e4fc5
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-False#UnionTypeAttribute.g.verified.cs
@@ -0,0 +1,43 @@
+//HintName: UnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class UnionTypeAttribute : Attribute
+ {
+ public Type Type { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; }
+#else
+ public string Alias { get; }
+#endif
+ public int Order { get; }
+ public bool AllowNull { get; set; }
+#if NETCOREAPP3_1_OR_GREATER
+ public object? TypeDiscriminator { get; set; }
+#else
+ public object TypeDiscriminator { get; set; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionTypeAttribute(Type type, string? alias = null, [CallerLineNumber] int order = 0)
+#else
+ public UnionTypeAttribute(Type type, string alias = null, [CallerLineNumber] int order = 0)
+#endif
+ {
+ Type = type;
+ Alias = alias;
+ Order = order;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..29d7087
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#GenericUnionTypeAttribute.g.verified.cs
@@ -0,0 +1,28 @@
+//HintName: GenericUnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class GenericUnionTypeAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object? TypeDiscriminator { get; set; }
+#else
+ public string Alias { get; set; }
+ public bool AllowNull { get; set; }
+ public object TypeDiscriminator { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
new file mode 100644
index 0000000..52628cf
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -0,0 +1,24 @@
+//HintName: JsonPolymorphicUnionAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class JsonPolymorphicUnionAttribute : Attribute
+ {
+#if NETCOREAPP3_1_OR_GREATER
+ public string? TypeDiscriminatorPropertyName { get; set; }
+#else
+ public string TypeDiscriminatorPropertyName { get; set; }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#Result.g.verified.cs
new file mode 100644
index 0000000..5490be7
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#Result.g.verified.cs
@@ -0,0 +1,286 @@
+//HintName: Result.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#pragma warning disable
+#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+partial struct Result : System.IEquatable
+{
+ private readonly int _variantId;
+ private const int SuccessId = 1;
+ private readonly global::Success _success;
+ public bool IsSuccess => _variantId == SuccessId;
+ public global::Success AsSuccess
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return _success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {ValueAlias} not Success.");
+ }
+ }
+
+ public Result(global::Success success)
+ {
+ System.ArgumentNullException.ThrowIfNull(success);
+ _variantId = SuccessId;
+ _success = success;
+ }
+
+ public static implicit operator Result(global::Success success) => new Result(success);
+ public static explicit operator global::Success(Result value)
+ {
+ if (value._variantId == SuccessId)
+ return value._success;
+ throw new System.InvalidOperationException($"Unable convert to Success. Inner value is {value.ValueAlias} not Success.");
+ }
+
+ public bool TryGetSuccess([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Success value)
+ {
+ if (_variantId == SuccessId)
+ {
+ value = _success;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int ErrorId = 2;
+ private readonly global::Error _error;
+ public bool IsError => _variantId == ErrorId;
+ public global::Error AsError
+ {
+ get
+ {
+ if (_variantId == ErrorId)
+ return _error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {ValueAlias} not Error.");
+ }
+ }
+
+ public Result(global::Error @error)
+ {
+ System.ArgumentNullException.ThrowIfNull(@error);
+ _variantId = ErrorId;
+ _error = @error;
+ }
+
+ public static implicit operator Result(global::Error @error) => new Result(@error);
+ public static explicit operator global::Error(Result value)
+ {
+ if (value._variantId == ErrorId)
+ return value._error;
+ throw new System.InvalidOperationException($"Unable convert to Error. Inner value is {value.ValueAlias} not Error.");
+ }
+
+ public bool TryGetError([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Error value)
+ {
+ if (_variantId == ErrorId)
+ {
+ value = _error;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ private const int WrappedOfIReadOnlyListOfStringId = 3;
+ private readonly global::Wrapped> _wrappedOfIReadOnlyListOfString;
+ public bool IsWrappedOfIReadOnlyListOfString => _variantId == WrappedOfIReadOnlyListOfStringId;
+ public global::Wrapped> AsWrappedOfIReadOnlyListOfString
+ {
+ get
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+ }
+
+ public Result(global::Wrapped> wrappedOfIReadOnlyListOfString)
+ {
+ System.ArgumentNullException.ThrowIfNull(wrappedOfIReadOnlyListOfString);
+ _variantId = WrappedOfIReadOnlyListOfStringId;
+ _wrappedOfIReadOnlyListOfString = wrappedOfIReadOnlyListOfString;
+ }
+
+ public static implicit operator Result(global::Wrapped> wrappedOfIReadOnlyListOfString) => new Result(wrappedOfIReadOnlyListOfString);
+ public static explicit operator global::Wrapped>(Result value)
+ {
+ if (value._variantId == WrappedOfIReadOnlyListOfStringId)
+ return value._wrappedOfIReadOnlyListOfString;
+ throw new System.InvalidOperationException($"Unable convert to WrappedOfIReadOnlyListOfString. Inner value is {value.ValueAlias} not WrappedOfIReadOnlyListOfString.");
+ }
+
+ public bool TryGetWrappedOfIReadOnlyListOfString([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out global::Wrapped> value)
+ {
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ value = _wrappedOfIReadOnlyListOfString;
+ return true;
+ }
+ else
+ {
+ value = default;
+ return false;
+ }
+ }
+
+ public TOut Match(global::System.Func matchSuccess, global::System.Func matchError, global::System.Func>, TOut> matchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ return matchSuccess(_success);
+ if (_variantId == ErrorId)
+ return matchError(_error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task MatchAsync(global::System.Func> matchSuccess, global::System.Func> matchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> matchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ return await matchSuccess(_success, ct).ConfigureAwait(false);
+ if (_variantId == ErrorId)
+ return await matchError(_error, ct).ConfigureAwait(false);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return await matchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public void Switch(global::System.Action switchSuccess, global::System.Action switchError, global::System.Action>> switchWrappedOfIReadOnlyListOfString)
+ {
+ if (_variantId == SuccessId)
+ {
+ switchSuccess(_success);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ switchError(_error);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public async global::System.Threading.Tasks.Task SwitchAsync(global::System.Func switchSuccess, global::System.Func switchError, global::System.Func>, global::System.Threading.CancellationToken, global::System.Threading.Tasks.Task> switchWrappedOfIReadOnlyListOfString, global::System.Threading.CancellationToken ct)
+ {
+ if (_variantId == SuccessId)
+ {
+ await switchSuccess(_success, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == ErrorId)
+ {
+ await switchError(_error, ct).ConfigureAwait(false);
+ return;
+ }
+
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ {
+ await switchWrappedOfIReadOnlyListOfString(_wrappedOfIReadOnlyListOfString, ct).ConfigureAwait(false);
+ return;
+ }
+
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public global::System.Type ValueType
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return typeof(global::Success);
+ if (_variantId == ErrorId)
+ return typeof(global::Error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return typeof(global::Wrapped>);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ private string ValueAlias
+ {
+ get
+ {
+ if (_variantId == SuccessId)
+ return "Success";
+ if (_variantId == ErrorId)
+ return "Error";
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return "WrappedOfIReadOnlyListOfString";
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ if (_variantId == SuccessId)
+ return _success.GetHashCode();
+ if (_variantId == ErrorId)
+ return _error.GetHashCode();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.GetHashCode();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public static bool operator ==(Result left, Result right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(Result left, Result right)
+ {
+ return !left.Equals(right);
+ }
+
+ public bool Equals(Result other)
+ {
+ if (ValueType != other.ValueType)
+ {
+ return false;
+ }
+
+ if (_variantId == SuccessId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_success, other._success);
+ if (_variantId == ErrorId)
+ return System.Collections.Generic.EqualityComparer.Default.Equals(_error, other._error);
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return System.Collections.Generic.EqualityComparer>>.Default.Equals(_wrappedOfIReadOnlyListOfString, other._wrappedOfIReadOnlyListOfString);
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override string ToString()
+ {
+ if (_variantId == SuccessId)
+ return _success.ToString();
+ if (_variantId == ErrorId)
+ return _error.ToString();
+ if (_variantId == WrappedOfIReadOnlyListOfStringId)
+ return _wrappedOfIReadOnlyListOfString.ToString();
+ throw new System.InvalidOperationException("Inner type is unknown");
+ }
+
+ public override bool Equals(object? obj)
+ {
+ return obj is Result other && Equals(other);
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs
new file mode 100644
index 0000000..3a119c2
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterAttribute.g.verified.cs
@@ -0,0 +1,33 @@
+//HintName: UnionConverterAttribute.g.cs
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterAttribute : Attribute
+ {
+ public Type FromType { get; }
+ public Type ToType { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? MethodName { get; }
+#else
+ public string MethodName { get; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionConverterAttribute(Type fromType, Type toType, string? methodName = null)
+#else
+ public UnionConverterAttribute(Type fromType, Type toType, string methodName = null)
+#endif
+ {
+ FromType = fromType;
+ ToType = toType;
+ MethodName = methodName;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs
new file mode 100644
index 0000000..43174eb
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterFromAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterFromAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterFromAttribute : Attribute
+ {
+ public Type FromType { get; }
+
+ public UnionConverterFromAttribute(Type fromType)
+ {
+ FromType = fromType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs
new file mode 100644
index 0000000..b72ef9e
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionConverterToAttribute.g.verified.cs
@@ -0,0 +1,25 @@
+//HintName: UnionConverterToAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ sealed class UnionConverterToAttribute : Attribute
+ {
+ public Type ToType { get; }
+
+ public UnionConverterToAttribute(Type toType)
+ {
+ ToType = toType;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs
new file mode 100644
index 0000000..72e4fc5
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GeneratorTests.WithoutNamespace_readonly-partial-struct-exclude-True#UnionTypeAttribute.g.verified.cs
@@ -0,0 +1,43 @@
+//HintName: UnionTypeAttribute.g.cs
+//
+// This code was generated by https://github.com/Ne4to/N.SourceGenerators.UnionTypes
+// Feel free to open an issue
+//
+#if NETCOREAPP3_1_OR_GREATER
+#nullable enable
+#endif
+using System;
+using System.Runtime.CompilerServices;
+
+namespace N.SourceGenerators.UnionTypes
+{
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
+ internal sealed class UnionTypeAttribute : Attribute
+ {
+ public Type Type { get; }
+#if NETCOREAPP3_1_OR_GREATER
+ public string? Alias { get; }
+#else
+ public string Alias { get; }
+#endif
+ public int Order { get; }
+ public bool AllowNull { get; set; }
+#if NETCOREAPP3_1_OR_GREATER
+ public object? TypeDiscriminator { get; set; }
+#else
+ public object TypeDiscriminator { get; set; }
+#endif
+
+#if NETCOREAPP3_1_OR_GREATER
+ public UnionTypeAttribute(Type type, string? alias = null, [CallerLineNumber] int order = 0)
+#else
+ public UnionTypeAttribute(Type type, string alias = null, [CallerLineNumber] int order = 0)
+#endif
+ {
+ Type = type;
+ Alias = alias;
+ Order = order;
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#OperationDataResultOfTAndTError.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#OperationDataResultOfTAndTError.g.verified.cs
index f31b42e..4eb6de9 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#OperationDataResultOfTAndTError.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#OperationDataResultOfTAndTError.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class OperationDataResult : System.IEquatable>
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.OnlyGenericTypes#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericResultNullableOfT.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericResultNullableOfT.g.verified.cs
index 570b180..c597238 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericResultNullableOfT.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericResultNullableOfT.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class GenericResultNullable : System.IEquatable>
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithAlias#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#OperationDataResultOfTResultAndTError.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#OperationDataResultOfTResultAndTError.g.verified.cs
index bbcaf10..0c7ebc4 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#OperationDataResultOfTResultAndTError.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#OperationDataResultOfTResultAndTError.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class OperationDataResult : System.IEquatable>
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/GenericUnionTests.WithCustomUnionType#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnion.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnion.g.verified.cs
index 7dc2348..f9f49fd 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnion.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnion.g.verified.cs
@@ -6,6 +6,7 @@
#pragma warning disable
#nullable enable
[JsonTestsUnionJsonConverter]
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class JsonTestsUnion : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverter.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverter.g.verified.cs
index 7673c93..37876f3 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverter.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverter.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class JsonTestsUnionJsonConverter : System.Text.Json.Serialization.JsonConverter
{
private static object? GetDiscriminator(object x)
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverterAttribute.g.verified.cs
index 357e311..c815992 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#JsonTestsUnionJsonConverterAttribute.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class JsonTestsUnionJsonConverterAttribute : System.Text.Json.Serialization.JsonConverterAttribute
{
public override System.Text.Json.Serialization.JsonConverter? CreateConverter(System.Type typeToConvert)
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/JsonTests.ItDoesNotFail#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#Result.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#Result.g.verified.cs
index 34fb582..87c954c 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#Result.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#Result.g.verified.cs
@@ -5,6 +5,7 @@
//
#pragma warning disable
#nullable enable
+[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Result : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/NullableValueTests.UseAllowNullAttribute#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#DataAccessModel.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#DataAccessModel.g.verified.cs
index 1121e86..0950459 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#DataAccessModel.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#DataAccessModel.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace DataAccess
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class DataAccessModel : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_0#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#BusinessLogicModel.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#BusinessLogicModel.g.verified.cs
index cf9b9be..07e20de 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#BusinessLogicModel.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#BusinessLogicModel.g.verified.cs
@@ -7,6 +7,7 @@
#nullable enable
namespace BusinessLogic
{
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class BusinessLogicModel : System.IEquatable
{
private readonly int _variantId;
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#GenericUnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#GenericUnionTypeAttribute.g.verified.cs
index 17a28f9..29d7087 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#GenericUnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#GenericUnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.GenericParameter, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class GenericUnionTypeAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#JsonPolymorphicUnionAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#JsonPolymorphicUnionAttribute.g.verified.cs
index ee781ad..52628cf 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#JsonPolymorphicUnionAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#JsonPolymorphicUnionAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class JsonPolymorphicUnionAttribute : Attribute
{
#if NETCOREAPP3_1_OR_GREATER
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterAttribute.g.verified.cs
index 973b6e2..3a119c2 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterAttribute.g.verified.cs
@@ -8,6 +8,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterFromAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterFromAttribute.g.verified.cs
index 222e936..43174eb 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterFromAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterFromAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterFromAttribute : Attribute
{
public Type FromType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterToAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterToAttribute.g.verified.cs
index 28901ff..b72ef9e 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterToAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionConverterToAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
sealed class UnionConverterToAttribute : Attribute
{
public Type ToType { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionTypeAttribute.g.verified.cs b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionTypeAttribute.g.verified.cs
index 927bc14..72e4fc5 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionTypeAttribute.g.verified.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/Snapshots/TwoAssemblyTests.UnionConverterFromInOtherAssembly_1#UnionTypeAttribute.g.verified.cs
@@ -12,6 +12,7 @@
namespace N.SourceGenerators.UnionTypes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = true)]
+ [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal sealed class UnionTypeAttribute : Attribute
{
public Type Type { get; }
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/TestHelper.cs b/tests/N.SourceGenerators.UnionTypes.Tests/TestHelper.cs
index 83cd2eb..9ad201c 100644
--- a/tests/N.SourceGenerators.UnionTypes.Tests/TestHelper.cs
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/TestHelper.cs
@@ -13,13 +13,15 @@ public static Task Verify(
string source,
LanguageVersion languageVersion = LanguageVersion.Latest,
string? parametersText = null,
+ UnionTypesAnalyzerConfigOptions? analyzerOptions = null,
params PortableExecutableReference[] additionalReferences)
where TGenerator : IIncrementalGenerator, new()
{
return Verify(
- [source],
- languageVersion,
+ [source],
+ languageVersion,
parametersText,
+ analyzerOptions,
additionalReferences);
}
@@ -27,6 +29,7 @@ public static async Task Verify(
string[] sources,
LanguageVersion languageVersion = LanguageVersion.Latest,
string? parametersText = null,
+ UnionTypesAnalyzerConfigOptions? analyzerOptions = null,
params PortableExecutableReference[] additionalReferences)
where TGenerator : IIncrementalGenerator, new()
{
@@ -40,23 +43,20 @@ public static async Task Verify(
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source, options);
// Create references for assemblies we require
// We could add multiple references if required
- var references = new List
- {
- MetadataReference.CreateFromFile(typeof(object).Assembly.Location)
- };
-
+ var references = new List { MetadataReference.CreateFromFile(typeof(object).Assembly.Location) };
+
references.AddRange(additionalReferences);
// /usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.11/System.Text.Json.dll
// Create a Roslyn compilation for the syntax tree.
CSharpCompilationOptions compilationOptions = new(OutputKind.DynamicallyLinkedLibrary);
-
+
CSharpCompilation compilation = CSharpCompilation.Create(
assemblyName: $"Tests{sourceIndex}",
syntaxTrees: new[] { syntaxTree },
references,
compilationOptions);
-
+
if (previousCompilation != null)
{
compilation = compilation.AddReferences(previousCompilation.ToMetadataReference());
@@ -66,7 +66,10 @@ public static async Task Verify(
var generator = new TGenerator();
// The GeneratorDriver is used to run our generator against a compilation
- GeneratorDriver driver = CSharpGeneratorDriver.Create(parseOptions: options, generators: [generator.AsSourceGenerator()]);
+ GeneratorDriver driver = CSharpGeneratorDriver.Create(
+ parseOptions: options,
+ generators: [generator.AsSourceGenerator()],
+ optionsProvider: new GeneratorAnalyzerConfigOptionsProvider(analyzerOptions));
// Run the source generator!
driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation,
diff --git a/tests/N.SourceGenerators.UnionTypes.Tests/UnionTypesAnalyzerConfigOptions.cs b/tests/N.SourceGenerators.UnionTypes.Tests/UnionTypesAnalyzerConfigOptions.cs
new file mode 100644
index 0000000..06a38b2
--- /dev/null
+++ b/tests/N.SourceGenerators.UnionTypes.Tests/UnionTypesAnalyzerConfigOptions.cs
@@ -0,0 +1,23 @@
+using System.Diagnostics.CodeAnalysis;
+
+using Microsoft.CodeAnalysis.Diagnostics;
+
+namespace N.SourceGenerators.UnionTypes.Tests;
+
+public class UnionTypesAnalyzerConfigOptions : AnalyzerConfigOptions
+{
+ private readonly Dictionary _options = new();
+
+ public static UnionTypesAnalyzerConfigOptions Default { get; } = new();
+
+ public bool ExcludeFromCodeCoverage
+ {
+ get => _options.GetValueOrDefault(UnionTypesGenerator.ExcludeFromCodeCoverageOption) == "true";
+ set => _options[UnionTypesGenerator.ExcludeFromCodeCoverageOption] = value.ToString();
+ }
+
+ public override bool TryGetValue(string key, [UnscopedRef] out string? value)
+ {
+ return _options.TryGetValue(key, out value);
+ }
+}
\ No newline at end of file