public void TestCreate02() { IGraphController graphController = new GraphController(null); IStorage storage = new BinaryStorage(); IVisualNode node = new FunctionNode(graphController, "", "-", "double,double"); ISlot slot1 = new Slot(graphController, SlotType.Input, node); slot1.Serialize(storage); storage.Seek(0, SeekOrigin.Begin); ISlot slot2 = Slot.Create(graphController, storage); Assert.AreEqual(SlotType.Input, slot2.SlotType); Assert.AreEqual(slot1.SlotId, slot2.SlotId); Assert.AreEqual(slot1.Owners[0], slot2.Owners[0]); Assert.AreEqual(slot1.ConnectingSlots, slot2.ConnectingSlots); }
public void TestSerializeNullException() { IGraphController graphController = new GraphController(null); IStorage storage = null; IVisualNode node = new FunctionNode(graphController, "", "-", "double,double"); ISlot slot = new Slot(graphController, SlotType.Input, node); Assert.Throws<ArgumentNullException>(() => { slot.Serialize(storage); }); }