Esempio n. 1
0
        public void TestDeserilaizeOperationException()
        {
            IGraphController graphController = new GraphController(null);
            IStorage storage = new BinaryStorage();
            CondensedNode node = new CondensedNode(graphController, "Hello World");

            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', ' ', ' ', ' ');
            storage.WriteUnsignedInteger(signature, 21);
            storage.Seek(0, SeekOrigin.Begin);

            bool result = node.Deserialize(storage);
            Assert.AreEqual(result, false);
        }
Esempio n. 2
0
        public void TestCreate02()
        {
            IGraphController graphController = new GraphController(null);
            IStorage storage = new BinaryStorage();

            storage.WriteUnsignedInteger(FieldCode.NodeSignature, 12);
            storage.WriteInteger(FieldCode.NodeType, 21);
            storage.Seek(0, SeekOrigin.Begin);

            Assert.Throws<ArgumentException>(() =>
            {
                IVisualNode node = VisualNode.Create(graphController, storage);
            });
        }
Esempio n. 3
0
        public void TestDeserilaizeOperationException()
        {
            IGraphController graphController = new GraphController(null);
            IStorage storage = new BinaryStorage();
            DataHeader header = new DataHeader();

            storage.WriteUnsignedInteger(FieldCode.DataHeaderSignature, 21);
            storage.Seek(0, SeekOrigin.Begin);

            Assert.Throws<InvalidOperationException>(() =>
            {
                header.Deserialize(storage);
            });
        }
Esempio n. 4
0
        public void TestDeserilaizeOperationException()
        {
            IGraphController graphController = new GraphController(null);
            IStorage storage = new BinaryStorage();
            IVisualNode node = new FunctionNode(graphController, "", "-", "double,double");
            ISlot slot = new Slot(graphController, SlotType.Input, node);

            storage.WriteUnsignedInteger(FieldCode.SlotSignature, 21);
            storage.Seek(0, SeekOrigin.Begin);

            Assert.Throws<InvalidOperationException>(() =>
            {
                slot.Deserialize(storage);
            });
        }
Esempio n. 5
0
        public void TestDeserilaizeOperationException()
        {
            IGraphController graphController = new GraphController(null);
            IStorage storage = new BinaryStorage();
            IVisualNode node = new DriverNode(graphController, Configurations.DriverInitialTextValue);

            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', ' ', ' ', ' ');
            storage.WriteUnsignedInteger(signature, 21);
            storage.Seek(0, SeekOrigin.Begin);

            bool result = node.Deserialize(storage);
            Assert.AreEqual(result, false);
        }
Esempio n. 6
0
        public void TestDeserilaizeOperationException()
        {
            IStorage storage = new BinaryStorage();
            GraphController graphController = new GraphController(null);
            EdgeController edgeController = new EdgeController(graphController);
            IVisualEdge edge = new VisualEdge(edgeController, 0x30000001, 0x30000002, false);

            storage.WriteUnsignedInteger(FieldCode.EdgeSignature, 12);
            storage.Seek(0, SeekOrigin.Begin);

            Assert.Throws<InvalidOperationException>(() =>
            {
                edge.Deserialize(storage);
            });
        }