Ejemplo n.º 1
0
        private static void SetupSystem(IEventBus eventBus)
        {
            _externalSystems = new ExternalSystems();
            var externalSystemsAdapter = new ExternalSystemsAdapter(_externalSystems);
            var gearbox              = new Gearbox();
            var gearboxAdapter       = new GearboxAdapter(gearbox);
            var automaticGearshifter = new AutomaticGearshifter(gearboxAdapter);

            eventBus.Attach(new EventLogger());
            eventBus.Attach(new EngineEmulator(_externalSystems));
            new AntiCorruptionLayerStartup(eventBus, externalSystemsAdapter, gearbox).Start();
            new GearshiftStartup(eventBus, automaticGearshifter).Start();
            new ProcessesStartup(eventBus, new GearshiftService(new Negotiator(), automaticGearshifter), new EngineCharacteristics(), new KickdownCharacteristics()).Start();
            TimeHelper.WaitSeconds(3);
        }
 public GearshiftStartup(IEventBus eventBus, AutomaticGearshifter gearshifter)
 {
     _eventBus    = eventBus;
     _gearshifter = gearshifter;
 }
Ejemplo n.º 3
0
 public void SetUp()
 {
     _gearboxMock = new Mock <IGearbox>();
     _programMock = new Mock <IShiftingProgram>();
     _gearshifter = new AutomaticGearshifter(_gearboxMock.Object);
 }
 public GearshiftService(Negotiator negotiator, AutomaticGearshifter gearshifter)
 {
     _negotiator  = negotiator;
     _gearshifter = gearshifter;
 }