예제 #1
0
        public void CommentTest2()
        {
            var text = SampleKif.CommentKif;

            // 棋譜の読み込み
            var kifu = KifuReader.LoadFrom(text);

            Assert.NotNull(kifu);
            Assert.Null(kifu.Error);

            // 手数の確認
            var count = 134;

            Assert.AreEqual(count, kifu.MoveList.Count());

            // コメントの確認
            var commentList = SampleKif.GetCommentList(SampleKif.CommentKif);

            for (var node = kifu.RootNode; node != null; node = node.NextNode)
            {
                Assert.AreEqual(commentList[node.MoveCount], node.Comment);
            }

            // 入出力テストを行います。
            TestUtil.ReadWriteTest(kifu, KifuFormat.Kif, count);
        }
예제 #2
0
파일: KifTest.cs 프로젝트: Shiiina/Ragnarok
        public void CommentTest2()
        {
            var sample = SampleKif.Get("Kif_Comment.kif");

            // 棋譜の読み込み
            var kifu = KifuReader.LoadFrom(sample);

            Assert.NotNull(kifu);
            Assert.Null(kifu.Error);

            // 手数の確認
            var count = 134;

            Assert.AreEqual(count, kifu.MoveList.Count());

            // コメントの確認
            var commentList = SampleKif.GetCommentList(sample);

            for (var node = kifu.RootNode; node != null; node = node.NextNode)
            {
                if (commentList[node.MoveCount] == null)
                {
                    Assert.False(node.CommentList.Any());
                }
                else
                {
                    Assert.AreEqual(commentList[node.MoveCount], node.CommentList);
                }
            }

            // 入出力テストを行います。
            TestUtil.ReadWriteTest(kifu, KifuFormat.Kif, count);
        }