source: trunk/TestCase/SimpleTestCase/XmlTest.ab@ 465

Last change on this file since 465 was 465, checked in by dai, 16 years ago

ActiveBasic.Xml.Parserを仮実装。
・SerializeTestのテストケースを追加。
・SimpleTestCaseにおいて、一時ディレクトリを扱えるようにした。
・XmlTestのテストケースを更新。

File size: 840 bytes
Line 
1Namespace XmlTest
2
3
4Sub TestMain()
5 ' 一時ディレクトリを取得
6 Dim tempDir = GetExclusiveTempDirPath( "XmlTest" )
7
8 Dim doc = New System.Xml.XmlDocument()
9 doc.AppendChild( doc.CreateXmlDeclaration( "1.0", "shift-jis", Nothing ) )
10 doc.AppendChild( doc.CreateElement( "root" ) )
11 doc.ChildNodes[1].AppendChild( doc.CreateElement( "test" ) )
12
13 Dim attr1 = doc.CreateAttribute( "attr1" )
14 attr1.Value = "123"
15 doc.ChildNodes[1].Attributes.Add( attr1 )
16 Dim attr2 = doc.CreateAttribute( "attr2" )
17 attr2.Value = "456"
18 doc.ChildNodes[1].Attributes.Add( attr2 )
19
20 ' 書いて
21 doc.Save( tempDir + "\test.xml" )
22
23 ' 読んで
24 Dim clone = New System.Xml.XmlDocument
25 clone.Load( tempDir + "\test.xml" )
26
27 ' 比較してみる
28 UnitTest( "XmlTest", doc.OuterXml = clone.OuterXml )
29End Sub
30
31
32End Namespace
33
34XmlTest.TestMain()
Note: See TracBrowser for help on using the repository browser.