public void TestModelSerialisationIntegrityUnbalanced()
        {
            var oldModel  = GetNetwork("unbalanced");
            var oldStream = new MemoryStream();

            oldModel.Serialise(oldStream);
            oldStream.Seek(0, SeekOrigin.Begin);
            NetworkModel model = (NetworkModel)QuickSerialisers.Deserialise(oldStream);

            ModelIntegrityAssertionsUnbalanced(model);
        }
Ejemplo n.º 2
0
        public void TestSerialisation()
        {
            var oldModel  = GetNetwork();
            var oldStream = new MemoryStream();

            oldModel.Serialise(oldStream);
            oldStream.Seek(0, SeekOrigin.Begin);
            NetworkModel model     = (NetworkModel)QuickSerialisers.Deserialise(oldStream);
            var          newStream = new MemoryStream();

            model.Serialise(newStream);
            Assert.IsTrue(newStream.ToArray().SequenceEqual(oldStream.ToArray()));
        }