Exemple #1
0
        public void IgnoreFuriganaWithOnlyWhitespace()
        {
            var reading = "あの[ ]人[ひと]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo("あの 人[ひと]"));
        }
Exemple #2
0
        public void MultipleGemsInsideWord()
        {
            var reading = "黒[くろ]熊[くま]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo(reading));
        }
Exemple #3
0
        public void FuriganaToHiragana()
        {
            var reading = "新[あたら]しい";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Hiragana, Is.EqualTo("あたらしい"));
        }
Exemple #4
0
        public void IgnoreEmptyFuriganaSection()
        {
            var reading = "あの[]人[ひと]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo("あの 人[ひと]"));
        }
Exemple #5
0
        public void FuriganaToExpression()
        {
            var reading = "動物[どうぶつ]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Expression, Is.EqualTo("動物"));
        }
Exemple #6
0
        public void FuriganaToHtmlRuby()
        {
            var reading = "新[あたら]しい";
            var result = "<ruby><rb>新</rb><rt>あたら</rt></ruby>しい";
            var formatter = new Furigana(reading);

            Assert.That(formatter.ReadingHtml, Is.EqualTo(result));
        }
Exemple #7
0
        public void NullReading()
        {
            var formatter = new Furigana(null);

            Assert.That(formatter.Reading, Is.EqualTo(""));
            Assert.That(formatter.Expression, Is.EqualTo(""));
            Assert.That(formatter.Hiragana, Is.EqualTo(""));
            Assert.That(formatter.ReadingHtml, Is.EqualTo(""));
        }
Exemple #8
0
        public void EmptyReading()
        {
            var reading = "";
            var formatter = new Furigana(reading);

            Assert.That(formatter.Reading, Is.EqualTo(""));
            Assert.That(formatter.Expression, Is.EqualTo(""));
            Assert.That(formatter.Hiragana, Is.EqualTo(""));
            Assert.That(formatter.ReadingHtml, Is.EqualTo(""));
        }
Exemple #9
0
        public void SingleGemInMiddleOfWord()
        {
            var reading = "新[あたら]しい";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo(reading));
        }
Exemple #10
0
        public void ReadingsWithoutGemsDoNotChange()
        {
            var reading = "ライオン";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo(reading));
        }
Exemple #11
0
        public void SpaceCanBeDelimiterBetweenFuriganaSegments()
        {
            var reading = "あの 人[ひと]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo("あの 人[ひと]"));
        }
Exemple #12
0
        public void SingleGemThatSpansEntireWord()
        {
            var reading = "動物[どうぶつ]";
            var furigana = new Furigana(reading);

            Assert.That(furigana.Reading, Is.EqualTo(reading));
        }