public CollectGasTankOperation( GasTankCollectionHandler owner, Action onDisposed) { _owner = owner; _onDisposed = onDisposed; }
public TestContext() { MockGasTankManager = new Mock <IGasTankManager>(); MockGasTankManager .Setup(x => x.Blocks.Count) .Returns(() => GasTankCount); MockLogger = new Mock <ILogger>(); MockDockingManagerSettingsProvider = new Mock <IDockingManagerSettingsProvider>(); MockDockingManagerSettingsProvider .Setup(x => x.Settings) .Returns(() => new DockingManagerSettings() { IgnoreBatteryBlocks = IgnoreOtherBlocks, IgnoreBeacons = IgnoreOtherBlocks, IgnoreGasGenerators = IgnoreOtherBlocks, IgnoreGasTanks = IgnoreGasTanks, IgnoreGyros = IgnoreOtherBlocks, IgnoreLandingGears = IgnoreOtherBlocks, IgnoreLightingBlocks = IgnoreOtherBlocks, IgnoreRadioAntennae = IgnoreOtherBlocks, IgnoreReactors = IgnoreOtherBlocks }); Uut = new GasTankCollectionHandler( MockGasTankManager.Object, MockLogger.Object, MockDockingManagerSettingsProvider.Object); MockBackgroundWorker = new FakeBackgroundWorker(); }
public Program() { var dateTimeProvider = new DateTimeProvider(); var loggerSettingsProvider = new LoggerSettingsProvider(); var managedBlockSettingsProvider = new ManagedBlockSettingsProvider(); var logger = new Logger( dateTimeProvider, loggerSettingsProvider); var managedBlockConfigParseHandlers = new IManagedBlockConfigParseHandler[] { managedBlockSettingsProvider }; var managerSettingsProvider = new ManagerSettingsProvider() { DefaultBlockTag = "AutomatedDocking" }; var batteryBlockManager = new BatteryBlockManager(); var connectorManager = new ConnectorManager(); var functionalBlockManager = new FunctionalBlockManager(); var gasTankManager = new GasTankManager(); var landingGearManager = new LandingGearManager(); var managedBlockConfigManager = new ManagedBlockConfigManager( logger, managedBlockConfigParseHandlers, managerSettingsProvider); var dockingManagerSettingsProvider = new DockingManagerSettingsProvider(); var batteryBlockCollectionHandler = new BatteryBlockCollectionHandler( batteryBlockManager, logger, dockingManagerSettingsProvider); var connectorCollectionHandler = new ConnectorCollectionHandler( connectorManager, logger); var functionalBlockCollectionHandler = new FunctionalBlockCollectionHandler( functionalBlockManager, logger, dockingManagerSettingsProvider); var gasTankCollectionHandler = new GasTankCollectionHandler( gasTankManager, logger, dockingManagerSettingsProvider); var landingGearCollectionHandler = new LandingGearCollectionHandler( landingGearManager, logger, dockingManagerSettingsProvider); var managedBlockCollectionHandler = new ManagedBlockCollectionHandler( managedBlockConfigManager, managedBlockSettingsProvider, managerSettingsProvider, Me); var backgroundWorkerSettingsProvider = new BackgroundWorkerSettingsProvider(); var blockCollectionHandlers = new IBlockCollectionHandler[] { managedBlockCollectionHandler, batteryBlockCollectionHandler, connectorCollectionHandler, functionalBlockCollectionHandler, gasTankCollectionHandler, landingGearCollectionHandler }; var backgroundWorker = new BackgroundWorker( backgroundWorkerSettingsProvider, dateTimeProvider, Runtime); var blockCollectionManager = new BlockCollectionManager <IMyTerminalBlock>( blockCollectionHandlers, GridTerminalSystem); var programReloadHandler = new ProgramReloadHandler( backgroundWorker, blockCollectionManager); var configParseHandlers = new IConfigParseHandler[] { backgroundWorkerSettingsProvider, loggerSettingsProvider, managerSettingsProvider, dockingManagerSettingsProvider, programReloadHandler }; var configManager = new ConfigManager( configParseHandlers, logger, Me); var dockingManager = new DockingManager( logger, batteryBlockManager, connectorManager, functionalBlockManager, gasTankManager, landingGearManager); var echoProvider = new EchoProvider(Echo); _programManager = new ProgramManager( backgroundWorker, configManager, dockingManager, echoProvider, Runtime, logger); _programManager.Run("reload"); }