-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The result of custom implementation of CreateInvalidItem is being che…
…ck so it doesn't return a key equals to valid key.
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 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
21 changes: 21 additions & 0 deletions
21
...tecture.Runtime.Extensions.Tests.Shared/TestEnums/TestEnumWithInvalidCreateInvalidItem.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,21 @@ | ||
namespace Thinktecture.Runtime.Tests.TestEnums | ||
{ | ||
public partial class TestEnumWithInvalidCreateInvalidItem : IValidatableEnum<int> | ||
{ | ||
public const int INVALID_KEY_FOR_TESTING_KEY_REUSE = 0; | ||
public const int INVALID_KEY_FOR_TESTING_ISVALID_TRUE = -1; | ||
|
||
public static readonly TestEnumWithInvalidCreateInvalidItem Item1 = new(1); | ||
|
||
private static TestEnumWithInvalidCreateInvalidItem CreateInvalidItem(int key) | ||
{ | ||
if (key == INVALID_KEY_FOR_TESTING_KEY_REUSE) | ||
return new(Item1.Key, false); | ||
|
||
if (key == INVALID_KEY_FOR_TESTING_ISVALID_TRUE) | ||
return new(key, true); | ||
|
||
return new(key, false); | ||
} | ||
} | ||
} |
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