OSDN Git Service

#28149 テンプレート名が空の不正なテンプレート呼び出しで処理が落ちていたのを修正,
[wptscs/wpts.git] / HmLibTest / Parsers / XmlCommentElementTest.cs
1 // ================================================================================================
2 // <summary>
3 //      XmlCommentElementのテストクラスソース。</summary>
4 //
5 // <copyright file="XmlCommentElementTest.cs" company="honeplusのメモ帳">
6 //      Copyright (C) 2011 Honeplus. All rights reserved.</copyright>
7 // <author>
8 //      Honeplus</author>
9 // ================================================================================================
10
11 namespace Honememo.Parsers
12 {
13     using System;
14     using NUnit.Framework;
15
16     /// <summary>
17     /// XmlCommentElementのテストクラスです。
18     /// </summary>
19     [TestFixture]
20     public class XmlCommentElementTest
21     {
22         #region コンストラクタテストケース
23
24         /// <summary>
25         /// コンストラクタテストケース。
26         /// </summary>
27         [Test]
28         public void TestConstructor()
29         {
30             XmlCommentElement comment = new XmlCommentElement();
31             Assert.IsNull(comment.Text);
32
33             comment = new XmlCommentElement("test");
34             Assert.AreEqual("test", comment.Text);
35         }
36
37         #endregion
38
39         #region インタフェース実装メソッドテストケース
40
41         /// <summary>
42         /// ToStringメソッドテストケース。
43         /// </summary>
44         [Test]
45         public void TestToString()
46         {
47             XmlCommentElement comment = new XmlCommentElement();
48             Assert.AreEqual("<!---->", comment.ToString());
49
50             comment.Text = "test";
51             Assert.AreEqual("<!--test-->", comment.ToString());
52
53             comment.ParsedString = "<!--test--";
54             Assert.AreEqual("<!--test--", comment.ToString());
55         }
56
57         #endregion
58     }
59 }