-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: #625 - marker interfaces for EFCore converters that were not nam…
…ed 'EfCoreConverters' caused problems because there were a couple of instances of hardcoded names
- Loading branch information
Showing
6 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/SnapshotTests/BugFixes/Bug625_EFCoreConverters_uses_wrong_marker_interface_name.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Threading.Tasks; | ||
using Shared; | ||
using Vogen; | ||
|
||
namespace SnapshotTests.BugFixes; | ||
|
||
// See https://github.com/SteveDunn/Vogen/issues/625 | ||
public class Bug625_EFCoreConverters_uses_wrong_marker_interface_name | ||
{ | ||
[Fact] | ||
public async Task A_marker_interface_not_named_EfCoreConverters_is_still_referenced_and_that_name_is_used_in_the_generated_code() | ||
{ | ||
var source = """ | ||
using System; | ||
using Vogen; | ||
[assembly: VogenDefaults( | ||
systemTextJsonConverterFactoryGeneration: SystemTextJsonConverterFactoryGeneration.Omit, | ||
conversions: Conversions.SystemTextJson | | ||
Conversions.TypeConverter | | ||
Conversions.SystemTextJson)] | ||
namespace Foo; | ||
[ValueObject<DateTime>] | ||
public partial struct HireDate; | ||
[ValueObject<string>] | ||
public partial struct Name; | ||
[ValueObject<int>] | ||
public partial struct Age; | ||
[EfCoreConverter<HireDate>] | ||
[EfCoreConverter<Name>] | ||
[EfCoreConverter<Age>] | ||
internal sealed partial class VogenEfCoreConverters; | ||
"""; | ||
|
||
await new SnapshotRunner<ValueObjectGenerator>() | ||
.WithSource(source) | ||
.IgnoreInitialCompilationErrors() | ||
.RunOn(TargetFramework.Net8_0); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...reConverters_is_still_referenced_and_that_name_is_used_in_the_generated_code.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
1 change: 1 addition & 0 deletions
1
...g_to_primitive_in_global_config_should_not_write_a_primitive_cast_to_wrapper.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|