public static PairwiseTestMatrix LoadFromXmlFile(string filename) { using (StreamReader sr = new StreamReader(filename)) { return((PairwiseTestMatrix)MatrixSerializer.Deserialize(sr)); } }
public IXPathNavigable CreateXPathNavigable() { using (MemoryStream ms = new MemoryStream()) { MatrixSerializer.Serialize(ms, this, xsn); ms.Seek(0, SeekOrigin.Begin); return(new XPathDocument(ms)); } }
public void TestSerialization() { string filePath = @"D:\github\repo\epam\tasks\task1\MatrixCore\MatrixTests\TestFiles\test.json"; MatrixSerializer.Serialize(matrix, filePath); Matrix deserialized = MatrixSerializer.Deserialize(filePath); Assert.AreEqual(matrix, deserialized); }
public void Serialize_Test() { // Arrange var example = new Matrix(new double[, ] { { 1, 2, 3 }, { 4, 5, 6 } }); // Act var result = new MatrixSerializer().Serialize(example); //Assert Assert.AreEqual("1 2 3\r\n4 5 6\r\n", result); }
public XmlDocument CreateXmlDocument() { XmlDocument xd = new XmlDocument(); using (MemoryStream ms = new MemoryStream()) { MatrixSerializer.Serialize(ms, this, xsn); ms.Seek(0, SeekOrigin.Begin); xd.Load(ms); } return(xd); }
public void WriteXmlTo(XmlTextWriter writer) { MatrixSerializer.Serialize(writer, this, xsn); }