Пример #1
0
        public virtual void TestProtoModel(GraphicalModel graphicalModel)
        {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

            graphicalModel.WriteToStream(byteArrayOutputStream);
            byteArrayOutputStream.Close();
            byte[] bytes = byteArrayOutputStream.ToByteArray();
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
            GraphicalModel       recovered            = GraphicalModel.ReadFromStream(byteArrayInputStream);

            NUnit.Framework.Assert.IsTrue(graphicalModel.ValueEquals(recovered, 1.0e-5));
        }
Пример #2
0
        public virtual void TestClone(GraphicalModel graphicalModel)
        {
            GraphicalModel clone = graphicalModel.CloneModel();

            NUnit.Framework.Assert.IsTrue(graphicalModel.ValueEquals(clone, 1.0e-5));
        }