예제 #1
0
 public void ReportTest_Initial()
 {
     var reporter = new Reporter.ReportRoot();
     var ReporterSerialization = new Reporter.ReportSerialization();
     var summary = new Reporter.Summary();
     summary.TestName = "asdfasdf";
     reporter.Summary = summary;
     ReporterSerialization.ReportSerialize(reporter, "c:\\temp\\aaa.xml");
 }
예제 #2
0
        public void ReportTest_Serialize()
        {
            var reporter = new Reporter.ReportRoot();
            var Summary = new Reporter.Summary();
            var Details = new Reporter.Details();
            List<Reporter.TestStep> TestStep = new List<Reporter.TestStep>();
            Reporter.InputDatas Inputdatas = new Reporter.InputDatas();
            List<Reporter.InputData> Inputdata = new List<Reporter.InputData>();
            Reporter.OutputDatas OutputDatas = new Reporter.OutputDatas();
            List<Reporter.OutputData> OutputData = new List<Reporter.OutputData>();
            Inputdata.Add(new Reporter.InputData {FieldName="Order Type",FieldValue="ZOR" });
            Inputdata.Add(new Reporter.InputData { FieldName = "Organization", FieldValue = "ZZ" });
            Inputdatas.InputData = Inputdata;
            OutputData.Add(new Reporter.OutputData { FieldName = "DocNo", FieldValue = "5555555" });
            OutputDatas.OutputData = OutputData;
            //Inputdatas.Add(new Reporter.InputDatas { InputData = Inputdata });
            TestStep.Add(new Reporter.TestStep {  CaseName="CaseName 123123",CaseStatus="Pass",StepName="va01_createasdfasdf",Number=1,InputDatas=Inputdatas,OutputDatas=OutputDatas});
            Summary.TestName = "Test Name 123123";
            reporter.Summary = Summary;

            Details.TestStep = TestStep;
            reporter.Details = Details;
            //Summary.TestName = "Test Name 123123";
            //TestStep.CaseName = "case name 123";
            //TestStep.CaseStatus = "Pass";
            //TestStep.Number = 1;
            //TestStep.StepName = "va01_createsalesorder";
            //inputdata.FieldName = "order type";
            //inputdata.FieldValue = "ZOR";
            //Inputdatas.InputData = inputdata;
            //TestStep.InputDatas = Inputdatas;
            //Details.TestStep = TestStep;
            //Reporter.Summary = Summary;

            //Reporter.Summary = Reporter.Summary();
            var ReporterSerialization = new Reporter.ReportSerialization();
            ReporterSerialization.ReportSerialize(reporter, "c:\\temp\\aaa.xml");
        }
예제 #3
0
        //public string TestOutputPath;
        public void initialize(string TestName)
        {
            string TestOutputPath;
            ReportRoot Report = new ReportRoot();
            ReportSerialization RS = new ReportSerialization();
            var Summary = new Summary();
            Summary.TestName = TestName;
            Report.Summary = Summary;
            string TestFolderName = @"C:\Temp\" + TestName;
            TestOutputPath = @"C:\Temp\" + TestName+"\\output.xml";
            if (!Directory.Exists(TestFolderName))
            {
                Directory.CreateDirectory(TestFolderName);
            }
            if(!File.Exists(@"C:\temp\DriverTemp.txt"))
            {
                FileStream fs = new FileStream(@"C:\temp\DriverTemp.txt", FileMode.Create, FileAccess.Write);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(TestOutputPath);
                sw.Close();
                fs.Close();
            }
            else
            {
                close();
                FileStream fs = new FileStream(@"C:\temp\DriverTemp.txt", FileMode.Create, FileAccess.Write);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(TestOutputPath);
                sw.Close();
                fs.Close();
            }
            RS.ReportSerialize(Report, TestOutputPath);

            //return TestOutputPath;
        }