-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support multiple mappers with the same name in different namespa…
…ces (#123)
- Loading branch information
Showing
6 changed files
with
62 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Riok.Mapperly.Tests.Mapping; | ||
|
||
[UsesVerify] | ||
public class MapperTest | ||
{ | ||
[Fact] | ||
public Task SameMapperNameInMultipleNamespacesShouldWork() | ||
{ | ||
var source = @" | ||
using Riok.Mapperly.Abstractions; | ||
namespace Test.A | ||
{ | ||
[Mapper] | ||
internal partial class FooBarMapper | ||
{ | ||
internal partial string FooToBar(string value); | ||
} | ||
} | ||
namespace Test.B | ||
{ | ||
[Mapper] | ||
internal partial class FooBarMapper | ||
{ | ||
internal partial string FooToBar(string value); | ||
} | ||
} | ||
"; | ||
|
||
return TestHelper.VerifyGenerator(source); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...hots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork.00FooBarMapper.g.verified.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,12 @@ | ||
//HintName: FooBarMapper.g.cs | ||
#nullable enable | ||
namespace Test.A | ||
{ | ||
internal partial class FooBarMapper | ||
{ | ||
internal partial string FooToBar(string value) | ||
{ | ||
return value; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork.01FooBarMapper1.g.verified.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,12 @@ | ||
//HintName: FooBarMapper1.g.cs | ||
#nullable enable | ||
namespace Test.B | ||
{ | ||
internal partial class FooBarMapper | ||
{ | ||
internal partial string FooToBar(string value) | ||
{ | ||
return value; | ||
} | ||
} | ||
} |