B
bg_ie
Hi,
I have a comma seperated file which I use to store data, and a
simplified version of it looks like this -
TestPeriod1 , ,
,TestTime , 55
,TestAction ,
, Phase1
, Phase2
,RunTest ,
, Test1
, Test2
, Test2
,
Test1
TestPeriod2 , ,
,TestTime , 10
,TestAction , Phase2
,RunTest , Test1
TestPeriod3 , ,
,TestAction , Phase1
,RunTest , Test2
Since I have no TestTime for TestPeriod3, I use a default time. Note
also that TestPeriod1's TestAction has two values - Phase1 and Phase2,
and its RunTest has 4 values, with Test1 and Test2 appearing twice.
What I'd like to do is represent this data structure in c# using a
class called TestInformation. This class would then contain an array
of type TestPeriod used to store TestPeriod1, TestPeriod2 etc. The
TestPeriod class would then contain a TestTime Member, an array of
type TestAction and an array of type RunTest.
Now as I said, the above is a simplification of what I'm actually
using and this structure is subject to change over time. Therefore,
I'm thinking that my first stage might be to convert the above comma
seperated file to xml first. Would you recommend this step? If so, how
would you represent in xml the fact that TestPeriod1's TestAction has
two values Phase1 and Phase2, and that the Test1 and Test2 values are
represented twice?
Secondly, once in xml format, how difficult would it be to serialize
an object of type TestInformation from my xml file?
Any other suggestions or tips?
Thanks,
Barry.
I have a comma seperated file which I use to store data, and a
simplified version of it looks like this -
TestPeriod1 , ,
,TestTime , 55
,TestAction ,
, Phase1
, Phase2
,RunTest ,
, Test1
, Test2
, Test2
,
Test1
TestPeriod2 , ,
,TestTime , 10
,TestAction , Phase2
,RunTest , Test1
TestPeriod3 , ,
,TestAction , Phase1
,RunTest , Test2
Since I have no TestTime for TestPeriod3, I use a default time. Note
also that TestPeriod1's TestAction has two values - Phase1 and Phase2,
and its RunTest has 4 values, with Test1 and Test2 appearing twice.
What I'd like to do is represent this data structure in c# using a
class called TestInformation. This class would then contain an array
of type TestPeriod used to store TestPeriod1, TestPeriod2 etc. The
TestPeriod class would then contain a TestTime Member, an array of
type TestAction and an array of type RunTest.
Now as I said, the above is a simplification of what I'm actually
using and this structure is subject to change over time. Therefore,
I'm thinking that my first stage might be to convert the above comma
seperated file to xml first. Would you recommend this step? If so, how
would you represent in xml the fact that TestPeriod1's TestAction has
two values Phase1 and Phase2, and that the Test1 and Test2 values are
represented twice?
Secondly, once in xml format, how difficult would it be to serialize
an object of type TestInformation from my xml file?
Any other suggestions or tips?
Thanks,
Barry.