Beispiel #1
0
        public void XmlLyricsReader_GetAllLines_WithNonDefaultTranslationID()
        {
            ILyricsLine[] Expected = new LyricsLine[] {
                new LyricsLine(22.19, 26.23, "Kanpeki na kuuki ni yotte himeru koakuma no"),
                new LyricsLine(26.24, 29.29, "Sukima o neratteku"),
                new LyricsLine(29.30, 29.51, ""),
                new LyricsLine(29.52, 33.57, "Yume ni mita mirai no sugoi souchi de"),
                new LyricsLine(33.57, 37.83, "Donna sekai mo tsukuridaseru"),
                new LyricsLine(38.37, 44.38, "Kono hoshi wa hajikeru sou da no you na")
            };

            using (Stream LyricsStream = SampleXmlLyrics.GetCorrectXmlLyricsFile()) {
                ILyricsReader Reader = new XmlLyricsReader(LyricsStream)
                {
                    TranslationID = "jp_romaji"
                };

                Assert.IsTrue(
                    Enumerable.SequenceEqual(
                        Expected,
                        Reader.GetAllLines()
                        )
                    );
            }
        }
Beispiel #2
0
        /// <summary>
        /// Checks if this object is equal to another given object.
        /// </summary>
        /// <param name="obj">The <see cref="object"/> instance to compare with.</param>
        /// <returns>True if the two objects are equal, false if not.</returns>
        public override bool Equals(object obj)
        {
            LyricsLine o = obj as LyricsLine;

            if (o == null)
            {
                return(false);
            }

            return
                (o.StartTime == this.StartTime &&
                 o.EndTime == this.EndTime &&
                 o.Text == this.Text);
        }
Beispiel #3
0
        public void XmlLyricsReader_GetAllLines_WithDefaultTranslationID()
        {
            ILyricsLine[] Expected = new LyricsLine[] {
                new LyricsLine(22.19, 26.23, "完璧な空気に酔って秘める小悪魔の"),
                new LyricsLine(26.24, 29.29, "隙間を狙ってく"),
                new LyricsLine(29.30, 29.51, ""),
                new LyricsLine(29.52, 33.57, "夢に見た未来の凄い装置で"),
                new LyricsLine(33.57, 37.83, "どんな世界も作り出せる"),
                new LyricsLine(38.37, 44.38, "この星は弾けるソーダのような")
            };

            using (Stream LyricsStream = SampleXmlLyrics.GetCorrectXmlLyricsFile()) {
                ILyricsReader Reader = new XmlLyricsReader(LyricsStream);

                Assert.IsTrue(
                    Enumerable.SequenceEqual(
                        Expected,
                        Reader.GetAllLines()
                        )
                    );
            }
        }