-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore/playwright-in-gha-k8s
- Loading branch information
Showing
27 changed files
with
1,659 additions
and
41 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 was deleted.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
backend/FwLite/MiniLcm.Tests/AutoFakerHelpers/WritingSystemIdOverride.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,16 @@ | ||
using MiniLcm.Models; | ||
using Soenneker.Utils.AutoBogus.Context; | ||
using Soenneker.Utils.AutoBogus.Override; | ||
|
||
namespace MiniLcm.Tests.AutoFakerHelpers; | ||
|
||
public class WritingSystemIdOverride: AutoFakerOverride<WritingSystemId> | ||
{ | ||
public override bool Preinitialize => false; | ||
|
||
public override void Generate(AutoFakerOverrideContext context) | ||
{ | ||
var ws = context.Faker.Random.ArrayElement(WritingSystemCodes.ValidTwoLetterCodes); | ||
context.Instance = new WritingSystemId(ws); | ||
} | ||
} |
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,8 @@ | ||
using SIL.WritingSystems; | ||
|
||
namespace MiniLcm.Tests; | ||
|
||
public static class WritingSystemCodes | ||
{ | ||
public static readonly string[] ValidTwoLetterCodes = StandardSubtags.RegisteredLanguages.Select(lang => lang.Code).ToArray(); | ||
} |
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,34 @@ | ||
using MiniLcm.Models; | ||
|
||
namespace MiniLcm.Tests; | ||
|
||
public class WritingSystemIdTests | ||
{ | ||
[Theory] | ||
[InlineData("en")] | ||
[InlineData("th")] | ||
[InlineData("en-Zxxx-x-audio")] | ||
public void ValidWritingSystemId_ShouldNotThrow(string code) | ||
{ | ||
var ws = new WritingSystemId(code); | ||
ws.Should().NotBeNull(); | ||
} | ||
|
||
[Theory] | ||
[InlineData("gx")] | ||
[InlineData("oo")] | ||
[InlineData("eng")] // Three-letter codes not allowed when there's a valid two-letter code | ||
[InlineData("eng-Zxxx-x-audio")] | ||
[InlineData("nonsense")] | ||
public void InvalidWritingSystemId_ShouldThrow(string code) | ||
{ | ||
Assert.Throws<ArgumentException>(() => new WritingSystemId(code)); | ||
} | ||
|
||
[Fact] | ||
public void DefaultWritingSystemId_IsValid() | ||
{ | ||
var ws = new WritingSystemId("default"); | ||
ws.Should().NotBeNull(); | ||
} | ||
} |
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
Oops, something went wrong.