Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/cs-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: C# tests
on:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0'
- name: Run tests
run: dotnet test MN.L10n.Tests
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void HandlesPluralizedPhrase()

var translation = translator.TranslateFileContents("_s(\"$__count$ minuter sedan\", {__count: 7});");

Assert.Equal($"(function(){{ var x = l10n.Phrases;x[\"{phrase}\"] = {{\"r\":{{\"0\":\"Now\",\"1\":\"$__count$ minutes ago\"}}}}; }})();\r\n_s(\"$__count$ minuter sedan\", {{__count: 7}});", translation);
Assert.Equal($"(function(){{ var x = l10n.Phrases;x[\"{phrase}\"] = {{\"r\":{{\"0\":\"Now\",\"1\":\"$__count$ minutes ago\"}}}}; }})();{Environment.NewLine}_s(\"$__count$ minuter sedan\", {{__count: 7}});", translation);
}

[Fact]
Expand All @@ -53,7 +53,7 @@ public void HandlesPluralizedPhraseInEval()

var translation = translator.TranslateFileContents("eval(\"_s(\\\"$__count$ minuter sedan\\\", {__count: 7});\");");

Assert.Equal($"(function(){{ var x = l10n.Phrases;x[\"{phrase}\"] = {{\"r\":{{\"0\":\"Now\",\"1\":\"$__count$ minutes ago\"}}}}; }})();\r\neval(\"_s(\\\"$__count$ minuter sedan\\\", {{__count: 7}});\");", translation);
Assert.Equal($"(function(){{ var x = l10n.Phrases;x[\"{phrase}\"] = {{\"r\":{{\"0\":\"Now\",\"1\":\"$__count$ minutes ago\"}}}}; }})();{Environment.NewLine}eval(\"_s(\\\"$__count$ minuter sedan\\\", {{__count: 7}});\");", translation);
}

[Fact]
Expand Down
1 change: 1 addition & 0 deletions MN.L10n.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE.txt = LICENSE.txt
README.md = README.md
TROUBLESHOOTING.md = TROUBLESHOOTING.md
.github\workflows\cs-tests.yml = .github\workflows\cs-tests.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MN.L10n.Javascript", "MN.L10n.Javascript\MN.L10n.Javascript.csproj", "{C2F42349-0F94-4291-A5E9-62806A3960FA}"
Expand Down
Loading