forked from kc3hack/2024_H
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#1-4 生成タスク周りをリファクタリング
- Loading branch information
Showing
11 changed files
with
119 additions
and
105 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Runtime.CompilerServices; | ||
using KoeBook.Epub.Services; | ||
|
||
namespace KoeBook.Test.Epub; | ||
|
||
public class AnalyzerServiceTest | ||
{ | ||
[Theory] | ||
[InlineData("aa", "aa")] | ||
[InlineData("<ruby><rb>漢字</rb><rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>", "かんじ")] | ||
[InlineData("ああ<ruby><rb>漢字</rb><rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>あああ", "ああかんじあああ")] | ||
[InlineData(""" | ||
ああ<ruby><rb>漢字</rb><rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>あああ | ||
ああ<ruby><rb>漢字</rb><rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>あああ | ||
ああ<ruby><rb>漢字1</rb><rp>(</rp><rt>かんじ1</rt><rp>)</rp></ruby>あああ | ||
""", "ああかんじあああ\nああかんじあああ\nああかんじ1あああ")] | ||
[InlineData("<ruby> <rb>佐久平</rb> <rp>\n《 </rp> <rt>さくだいら</rt> <rp>》</rp> </ruby> <ruby><rb>啓介</rb><rp>《</rp><rt>けいすけ</rt><rp>》</rp></ruby>", | ||
"さくだいら けいすけ")] | ||
[InlineData("<ruby><rb>漢字</rb>\n<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>", "かんじ")] | ||
[InlineData("ああ<ruby><rb>漢字</rb><rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>あああ<ruby><rb>漢字</rb><rp>(</rp><rt>カンジ</rt><rp>)</rp></ruby>", "ああかんじあああカンジ")] | ||
public void ReplaceBaseTextWithRuby(string input, string expected) | ||
{ | ||
var result = AnalyzerServiceProxy.ReplaceBaseTextWithRuby(null, input); | ||
|
||
Assert.Equal(expected, result); | ||
} | ||
} | ||
|
||
file static class AnalyzerServiceProxy | ||
{ | ||
[UnsafeAccessor(UnsafeAccessorKind.StaticMethod)] | ||
public static extern string ReplaceBaseTextWithRuby(AnalyzerService? _, string text); | ||
} |
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