Last change
on this file since 467 was 465, checked in by dai, 17 years ago |
・ActiveBasic.Xml.Parserを仮実装。
・SerializeTestのテストケースを追加。
・SimpleTestCaseにおいて、一時ディレクトリを扱えるようにした。
・XmlTestのテストケースを更新。
|
File size:
840 bytes
|
Rev | Line | |
---|
[424] | 1 | Namespace XmlTest
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | Sub TestMain()
|
---|
[465] | 5 | ' 一時ディレクトリを取得
|
---|
| 6 | Dim tempDir = GetExclusiveTempDirPath( "XmlTest" )
|
---|
| 7 |
|
---|
[424] | 8 | Dim doc = New System.Xml.XmlDocument()
|
---|
[465] | 9 | doc.AppendChild( doc.CreateXmlDeclaration( "1.0", "shift-jis", Nothing ) )
|
---|
[424] | 10 | doc.AppendChild( doc.CreateElement( "root" ) )
|
---|
| 11 | doc.ChildNodes[1].AppendChild( doc.CreateElement( "test" ) )
|
---|
[444] | 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 |
|
---|
[465] | 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 )
|
---|
[424] | 29 | End Sub
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | End Namespace
|
---|
| 33 |
|
---|
| 34 | XmlTest.TestMain()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.