Ejemplo n.º 1
0
 public static XElement Write(object instance)
 {
     if (instance is string)
     {
         return(TestSerializer.WriteString((string)instance));
     }
     else if (instance is XElement)
     {
         return(TestSerializer.WriteElement((XElement)instance));
     }
     else if (instance is TestResult)
     {
         return(TestSerializer.WriteTestResult((TestResult)instance));
     }
     else if (instance is TestLoggerBackend.LogEntry)
     {
         return(TestSerializer.WriteLogEntry((TestLoggerBackend.LogEntry)instance));
     }
     else if (instance is TestLoggerBackend.StatisticsEventArgs)
     {
         return(TestSerializer.WriteStatisticsEvent((TestLoggerBackend.StatisticsEventArgs)instance));
     }
     else if (instance is ObjectProxy)
     {
         return(RemoteObjectManager.WriteProxy((ObjectProxy)instance));
     }
     else
     {
         throw new ServerErrorException();
     }
 }
Ejemplo n.º 2
0
        static XElement WriteTestCaseList(IEnumerable <TestCaseServant> list)
        {
            var root = new XElement("TestCaseList");

            foreach (var child in list)
            {
                root.Add(RemoteObjectManager.WriteProxy(child));
            }
            return(root);
        }