public void StatusMessageSerializationTest() { IOThread ioThread = new IOThread { State = EState.Busy, ProblemInstanceId = 123L, ProblemType = "ProblemType", TaskId = 321L }; var threadList = new List <IOThread>(); threadList.Add(ioThread); var registerStatusMessage = new StatusMessage(123L, threadList); var result = registerStatusMessage.SerializeToXml(); Assert.IsNotNull(result); Assert.AreNotEqual(0, result.Length); var xmlValidator = new XmlValidator(); var xsdSchemaFile = "StatusMessage.xsd"; var xsdSchemaPath = Path.Combine(_xsdSchemasPath, xsdSchemaFile); var validationResult = xmlValidator.Validate(result, xsdSchemaPath, true); var errorsCount = validationResult.Errors.Count + validationResult.Warnings.Count; Assert.AreEqual(0, errorsCount); #region ExampleResult //<?xml version="1.0" encoding="utf-16"?> //<Status xmlns="http://www.mini.pw.edu.pl/ucc/"> // <Id>123</Id> // <Threads> // <IOThread> // <State>Busy</State> // <HowLong>00:00:00</HowLong> // <ProblemInstanceId>123</ProblemInstanceId> // <TaskId>321</TaskId> // <ProblemType>ProblemType</ProblemType> // </IOThread> // </Threads> //</Status> #endregion }