diff --git a/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs b/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs index b8551028..cbe80a2b 100644 --- a/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs +++ b/src/UnitTests/LinearAlgebraTests/MatrixStorageSerializationTests.cs @@ -94,7 +94,10 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests [Test] public void DenseColumnMajorMatrixStorageOfComplex64DataContractSerializationTest() { - MatrixStorage expected = Matrix.Build.Dense(2, 2, new[] { new Complex64(1.0, -1.0), 2.0, 0.0, 3.0 }).Storage; + var expectedMatrix = Matrix + .Build + .Dense(2, 2, new[] { new Complex64(1.0, -1.0), 2.0, 0.0, 3.0 }); + MatrixStorage expected = expectedMatrix.Storage; var serializer = new DataContractSerializer(typeof(MatrixStorage), KnownTypes); var stream = new MemoryStream(); @@ -102,12 +105,15 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests stream.Position = 0; var actual = (MatrixStorage)serializer.ReadObject(stream); + var actualMatrix = Matrix + .Build + .Dense(actual as DenseColumnMajorMatrixStorage); Assert.That(actual.RowCount, Is.EqualTo(expected.RowCount)); Assert.That(actual.ColumnCount, Is.EqualTo(expected.ColumnCount)); Assert.That(actual, Is.TypeOf(typeof(DenseColumnMajorMatrixStorage))); - Assert.That(actual, Is.EqualTo(expected)); - Assert.That(actual, Is.Not.SameAs(expected)); + Assert.That(actualMatrix, Is.EqualTo(expectedMatrix)); + Assert.That(actualMatrix, Is.Not.SameAs(expectedMatrix)); } [Test]