WOX2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
using System;
using NUnit.Framework;
using wox.serial.tests.objects;
/// <header>
/// <wox>
/// <version>1.0</version>
/// <author>Carlos R. Jaimez Gonzalez</author>
/// <author>Simon M. Lucas</author>
/// <site>http://woxserializer.sourceforge.net/</site>
/// </wox>
/// <wox>
/// <version>1.5</version>
/// <author>Steven M Lewis</author>
/// </wox>
/// <wox>
/// <version>2.0</version>
/// <author>George A Smith</author>
/// <svn>http://woxserializer.sourceforge.net/</svn>
/// <note>XML form for vs 2 is more compact and therefor incompatible with vs 1</note>
/// </wox>
/// </header>
namespace wox.serial.tests.mains
{
public class TestStudent
{
/// <summary>
/// This method shows how easy is to serialize and de-serialize C# objects to/from XML.
/// </summary>
// public static void Main( string[] pArgs )
public static void WantTaBeMain(String[] pArgs)
{
var easy = new Easy();
Course[] courses = {
new Course( 6756, "XML and Related Technologies", 2 ),
new Course( 9865, "Object Oriented Programming", 2 ),
new Course( 1134, "E-Commerce Programming", 3 )
};
var student = new Student( "Carlos Jaimez", 76453, courses );
//print the Student object
Console.Out.WriteLine( student );
//object to standard XML
String data = easy.Format(student);
//object from the XML
var newStudent = (Student)easy.Parse(data);
//print the new object - it is the same as before
Console.Out.WriteLine( newStudent );
Assert.AreEqual(data, easy.Format(newStudent));
}
}
}
|
Revision |
Author |
Commited |
Message |
14
Diff
|
GeorgeS
|
Fri 19 Feb, 2010 19:15:03 +0000 |
|
3
|
GeorgeS
|
Thu 04 Feb, 2010 23:53:47 +0000 |
|