Skip to content

Commit

Permalink
chore: use raw string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
latonz committed Aug 28, 2023
1 parent f185e2d commit 78f8266
Show file tree
Hide file tree
Showing 44 changed files with 97 additions and 96 deletions.
29 changes: 15 additions & 14 deletions test/Riok.Mapperly.Tests/TestSourceBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ public static string MapperWithBody([StringSyntax(StringSyntax.CSharp)] string b
{
options ??= TestSourceBuilderOptions.Default;

return $@"
using System;
using System.Collections.Generic;
using Riok.Mapperly.Abstractions;
using Riok.Mapperly.Abstractions.ReferenceHandling;
{(options.Namespace != null ? $"namespace {options.Namespace};" : string.Empty)}
{BuildAttribute(options)}
public partial class Mapper
{{
{body}
}}
";
return CSharp(
$$"""
using System;
using System.Collections.Generic;
using Riok.Mapperly.Abstractions;
using Riok.Mapperly.Abstractions.ReferenceHandling;
{{(options.Namespace != null ? $"namespace {options.Namespace};" : string.Empty)}}
{{BuildAttribute(options)}}
public partial class Mapper
{
{{body}}
}
""");
}

public static string MapperWithBodyAndTypes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: No accessible parameterless constructor found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,51),
Location: : (10,4)-(10,51),
Description: ,
HelpLink: ,
MessageFormat: {0} has no accessible parameterless constructor,
Expand All @@ -17,7 +17,7 @@
Title: No accessible parameterless constructor found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,51),
Location: : (10,4)-(10,51),
Description: ,
HelpLink: ,
MessageFormat: {0} has no accessible parameterless constructor,
Expand All @@ -29,7 +29,7 @@
Title: Could not create mapping,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,51),
Location: : (10,4)-(10,51),
Description: ,
HelpLink: ,
MessageFormat: Could not create mapping from {0} to {1}. Consider implementing the mapping manually.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (8,0)-(12,1),
Location: : (7,0)-(11,1),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -17,7 +17,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -29,7 +29,7 @@
Title: An enum member could not be found on the target enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3},
Expand All @@ -41,7 +41,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -53,7 +53,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -65,7 +65,7 @@
Title: An enum member could not be found on the source enum,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3},
Expand All @@ -77,7 +77,7 @@
Title: No overlapping enum members found,
Severity: Warning,
WarningLevel: 1,
Location: : (11,4)-(11,69),
Location: : (10,4)-(10,69),
Description: ,
HelpLink: ,
MessageFormat: {0} and {1} don't have overlapping enum member names, mapping will therefore always result in an exception,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: No accessible parameterless constructor found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,34),
Location: : (10,4)-(10,34),
Description: ,
HelpLink: ,
MessageFormat: {0} has no accessible parameterless constructor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Could not create mapping,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,28),
Location: : (10,4)-(10,28),
Description: ,
HelpLink: ,
MessageFormat: Could not create mapping from {0} to {1}. Consider implementing the mapping manually.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Cannot map to the configured constructor to be used by Mapperly,
Severity: Warning,
WarningLevel: 1,
Location: : (11,4)-(11,28),
Location: : (10,4)-(10,28),
Description: ,
HelpLink: ,
MessageFormat: Cannot map from {0} to the configured constructor {1},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: No accessible constructor with mappable arguments found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,28),
Location: : (10,4)-(10,28),
Description: ,
HelpLink: ,
MessageFormat: {0} has no accessible constructor with mappable arguments,
Expand All @@ -17,7 +17,7 @@
Title: Source member is not mapped to any target member,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,28),
Location: : (10,4)-(10,28),
Description: ,
HelpLink: ,
MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Source member is not mapped to any target member,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,28),
Location: : (10,4)-(10,28),
Description: ,
HelpLink: ,
MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: No accessible parameterless constructor found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,68),
Location: : (10,4)-(10,68),
Description: ,
HelpLink: ,
MessageFormat: {0} has no accessible parameterless constructor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Mapping source member not found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,71),
Location: : (10,4)-(10,71),
Description: ,
HelpLink: ,
MessageFormat: Specified member {0} on source type {1} was not found,
Expand All @@ -17,7 +17,7 @@
Title: Source member is not mapped to any target member,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,71),
Location: : (10,4)-(10,71),
Description: ,
HelpLink: ,
MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Title: Mapping target member not found,
Severity: Error,
WarningLevel: 0,
Location: : (11,4)-(11,71),
Location: : (10,4)-(10,71),
Description: ,
HelpLink: ,
MessageFormat: Specified member {0} on mapping target type {1} was not found,
Expand All @@ -17,7 +17,7 @@
Title: Source member is not mapped to any target member,
Severity: Info,
WarningLevel: 1,
Location: : (11,4)-(11,71),
Location: : (10,4)-(10,71),
Description: ,
HelpLink: ,
MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2},
Expand Down
Loading

0 comments on commit 78f8266

Please sign in to comment.