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); }
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); }