From dc0a633cc9dbc6696d9cfdef3b8c8b68cb443b8c Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Carle <29762210+jscarle@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:07:19 -0500 Subject: [PATCH] Sealed classes. --- .../GeneratedIdentifierSourceGenerator.cs | 2 +- .../LightResults.Extensions.GeneratedIdentifier.csproj | 2 +- ...torTests.GenerateStringIdentifier_WithNamespace.verified.txt | 2 +- ...Tests.GenerateStringIdentifier_WithoutNamespace.verified.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LightResults.Extensions.GeneratedIdentifier/GeneratedIdentifierSourceGenerator.cs b/src/LightResults.Extensions.GeneratedIdentifier/GeneratedIdentifierSourceGenerator.cs index 5f8d395..755ce22 100644 --- a/src/LightResults.Extensions.GeneratedIdentifier/GeneratedIdentifierSourceGenerator.cs +++ b/src/LightResults.Extensions.GeneratedIdentifier/GeneratedIdentifierSourceGenerator.cs @@ -157,7 +157,7 @@ namespace {symbolNamespace}; source.AppendLine($$""" [TypeConverter(typeof({{symbolName}}TypeConverter))] [JsonConverter(typeof({{symbolName}}JsonConverter))] - {{(isStruct ? "readonly " : "")}}partial {{(isStruct ? "struct" : "class")}} {{symbolName}} : + {{(isStruct ? "readonly" : "sealed")}} partial {{(isStruct ? "struct" : "class")}} {{symbolName}} : ICreatableValueObject<{{declaredValueType}}, {{symbolName}}>, """ ); diff --git a/src/LightResults.Extensions.GeneratedIdentifier/LightResults.Extensions.GeneratedIdentifier.csproj b/src/LightResults.Extensions.GeneratedIdentifier/LightResults.Extensions.GeneratedIdentifier.csproj index 6ae95b1..52ede9e 100644 --- a/src/LightResults.Extensions.GeneratedIdentifier/LightResults.Extensions.GeneratedIdentifier.csproj +++ b/src/LightResults.Extensions.GeneratedIdentifier/LightResults.Extensions.GeneratedIdentifier.csproj @@ -36,7 +36,7 @@ LightResults.Extensions.GeneratedIdentifier - 9.0.0-preview.6 + 9.0.0-preview.7 9.0.0.0 9.0.0.0 en-US diff --git a/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithNamespace.verified.txt b/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithNamespace.verified.txt index 4b92012..afd6496 100644 --- a/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithNamespace.verified.txt +++ b/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithNamespace.verified.txt @@ -21,7 +21,7 @@ namespace MyProject.Identifiers; [TypeConverter(typeof(TestStringIdTypeConverter))] [JsonConverter(typeof(TestStringIdJsonConverter))] -partial class TestStringId : +sealed partial class TestStringId : ICreatableValueObject, IValueObject, IComparable, diff --git a/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithoutNamespace.verified.txt b/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithoutNamespace.verified.txt index 5010451..d3bbc83 100644 --- a/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithoutNamespace.verified.txt +++ b/tests/LightResults.Extensions.GeneratedIdentifier.Tests/GeneratedIdentifierSourceGeneratorTests.GenerateStringIdentifier_WithoutNamespace.verified.txt @@ -19,7 +19,7 @@ using LightResults.Extensions.ValueObjects; [TypeConverter(typeof(TestStringIdTypeConverter))] [JsonConverter(typeof(TestStringIdJsonConverter))] -partial class TestStringId : +sealed partial class TestStringId : ICreatableValueObject, IValueObject, IComparable,