コード例 #1
0
        public void RoundTripXmlSerialization()
        {
            testPackageRun.RootTestStepRun = new TestStepRun(new TestStepData("stepId", "stepName", "stepFullName", "testId"));

            TestPackageRun deserializedTestPackageRun = Assert.XmlSerializeThenDeserialize(testPackageRun);

            ReportAssert.AreEqual(testPackageRun, deserializedTestPackageRun);
        }
コード例 #2
0
ファイル: ReportTest.cs プロジェクト: soelske/mbunit-v3
        public void RoundTripXmlSerialization()
        {
            XmlSerializer serializer = new XmlSerializer(typeof(Report));
            StringWriter  writer     = new StringWriter();

            Report report = new Report();

            report.TestPackageRun = new TestPackageRun();
            report.TestPackageRun.RootTestStepRun = new TestStepRun(new TestStepData("456", "abc", "456:abc", "testId"));
            report.TestPackageRun.RootTestStepRun.Children.Add(new TestStepRun(new TestStepData("child", "child", "child", "child")));

            serializer.Serialize(writer, report);

            Report deserializedReport = (Report)serializer.Deserialize(new StringReader(writer.ToString()));

            ReportAssert.AreEqual(report, deserializedReport);
        }