Пример #1
0
 // The constructor creates a Connection from the source to the destination
 public Connection(IConnectable source, string sourceOutput, IConnectable destination, string destinationInput, Color typeColor)
 {
     Source           = source;
     SourceOutput     = sourceOutput;
     Destination      = destination;
     DestinationInput = destinationInput;
     ConnectionType   = ConnectionTypeFactory.GetType(typeColor);
 }
        public void ConnectionTypeTestConstructorComplex()
        {
            var newConnectionType = new ConnectionType("DriveCommand", "DriveCommand", "new DriveCommand()", "new DriveCommand()");

            ConnectionTypeFactory.RegisterType(Color.Cyan, newConnectionType);

            var connectionType = ConnectionTypeFactory.GetType(Color.Cyan);

            Assert.AreEqual(newConnectionType, connectionType);
        }
 public IConnection Connect(IConnectable destination, string outputName, string inputName, IConnectionType type)
 {
     return(Connect(destination, outputName, inputName, ConnectionTypeFactory.GetColor(type)));
 }
 private static IConnectionType Double() => ConnectionTypeFactory.GetType(Blue);
 private static IConnectionType Boolean() => ConnectionTypeFactory.GetType(Green);
 private static IConnectionType Integer() => ConnectionTypeFactory.GetType(Red);