-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
138 additions
and
19 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
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
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
37 changes: 37 additions & 0 deletions
37
tests/SnapshotTests/BugFixes/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.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,37 @@ | ||
using System.Threading.Tasks; | ||
using Shared; | ||
using Vogen; | ||
|
||
namespace SnapshotTests.BugFixes; | ||
|
||
// See https://github.com/SteveDunn/Vogen/issues/720 | ||
public class Bug720_Inconsistent_casting_mixed_with_IVogen_generation | ||
{ | ||
[Fact] | ||
public async Task Works_when_the_static_abstracts_and_implementation_have_same_casting() | ||
{ | ||
// we say that to primitive is implicit and we say that the static abstract interface matches. | ||
var source = """ | ||
using Vogen; | ||
using static Vogen.StaticAbstractsGeneration; | ||
[assembly: VogenDefaults( | ||
toPrimitiveCasting: CastOperator.Implicit, | ||
staticAbstractsGeneration: ValueObjectsDeriveFromTheInterface | | ||
EqualsOperators | | ||
ExplicitCastFromPrimitive | | ||
ImplicitCastToPrimitive | | ||
FactoryMethods)] | ||
namespace MyApp; | ||
[ValueObject<int>] | ||
public readonly partial record struct ToDoItemId; | ||
"""; | ||
|
||
await new SnapshotRunner<ValueObjectGenerator>() | ||
.WithSource(source) | ||
.IgnoreInitialCompilationErrors() | ||
.RunOn(TargetFramework.AspNetCore8_0); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...spNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Builds.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
...pNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Builds2.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
...eration.Works_when_the_static_abstracts_and_implementation_have_same_casting.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 @@ | ||
|
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