Skip to content

Commit

Permalink
fix error message for RiddleSolutionInvalidLengthError
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinath committed Jul 30, 2023
1 parent 11c97fa commit 426f9bd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Domain/EscapeGames/Errors/RiddleSolutionInvalidLengthError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Domain.EscapeGames.Errors;

public class RiddleSolutionInvalidLengthError : Error
{
public RiddleSolutionInvalidLengthError(int expectedLength)
: base(string.Format(_Errors.RiddleSolutionInvalidLengthErrorMessage, expectedLength))
public RiddleSolutionInvalidLengthError(params int[] expectedLengths)
: base(string.Format(_Errors.RiddleSolutionInvalidLengthErrorMessage, string.Join(", ", expectedLengths)))
{ }
}
2 changes: 1 addition & 1 deletion Domain/EscapeGames/Errors/_Errors.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Domain/EscapeGames/Errors/_Errors.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<value>Die Rätsellösung darf nur Zahlen von 0-9 enthalten.</value>
</data>
<data name="RiddleSolutionInvalidLengthErrorMessage" xml:space="preserve">
<value>Die Rätsellösung muss {0} Zeichen lang sein.</value>
<value>Die Rätsellösungen müssen eine der folgenden Längen haben: {0}</value>
</data>
<data name="RiddleSolutionMustNotBeEmptyErrorMessage" xml:space="preserve">
<value>Die Rästellösungen dürfen nicht leer sein.</value>
Expand Down
2 changes: 1 addition & 1 deletion Domain/EscapeGames/Errors/_Errors.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<value>La solution de l'énigme ne peut contenir que des chiffres de 0 à 9.</value>
</data>
<data name="RiddleSolutionInvalidLengthErrorMessage" xml:space="preserve">
<value>La solution de l'énigme doit comporter {0} caractères.</value>
<value>Les solutions de l'énigme doivent avoir l'une des longueurs suivantes : {0}</value>
</data>
<data name="RiddleSolutionIsNotCorrectErrorMessage" xml:space="preserve">
<value>La solution n'est pas correcte.</value>
Expand Down
2 changes: 1 addition & 1 deletion Domain/EscapeGames/Errors/_Errors.resx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="RiddleSolutionInvalidLengthErrorMessage" xml:space="preserve">
<value>Riddle solution must have length {0}.</value>
<value>Riddle solutions must have one of the following lengths: {0}</value>
</data>
<data name="RiddleSolutionMustNotBeEmptyErrorMessage" xml:space="preserve">
<value>Riddle solutions must not be empty.</value>
Expand Down
2 changes: 1 addition & 1 deletion Domain/EscapeGames/ValueObjects/RiddleSolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static Result<RiddleSolution> Create(string? riddleSolution)

var length = riddleSolution?.Trim().Length ?? 0;
if (!AllowedSolutionLengths.Contains(length))
result.WithError(new RiddleSolutionInvalidLengthError(expectedLength: 3));
result.WithError(new RiddleSolutionInvalidLengthError(AllowedSolutionLengths.ToArray()));

if (result.IsFailed)
return result;
Expand Down
2 changes: 1 addition & 1 deletion LockEscape.sln.DotSettings.user
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@



<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Domain_002FEscapeGames_002FErrors_002F_005FErrors/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Domain_002FEscapeGames_002FErrors_002F_005FErrors/@EntryIndexedValue">True</s:Boolean>

<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=LockEscape_002FPages_002FComponents_002F_005FPopup/@EntryIndexedValue">False</s:Boolean>

Expand Down

0 comments on commit 426f9bd

Please sign in to comment.