public void Init() { _deploymentHostManager = new Mock <IDeploymentHostManager>(); _dependencyManager = new Mock <IDependencyManager>(); _deploymentInstanceRepo = new Mock <IDeploymentInstanceRepo>(); _deviceRepoManager = new Mock <IDeviceRepositoryManager>(); _adminLogger = new Mock <IAdminLogger>(); _security = new Mock <ISecurity>(); _secureStorage = new Mock <ISecureStorage>(); _appConfig = new Mock <IAppConfig>(); _secureStorage.Setup(ss => ss.AddSecretAsync(It.IsAny <EntityHeader>(), It.IsAny <string>())).ReturnsAsync(InvokeResult <string> .Create("XXXX")); _instanceManager = new DeploymentInstanceManagerCore(_deploymentHostManager.Object, _deploymentInstanceRepo.Object, _deviceRepoManager.Object, _secureStorage.Object, _instanceStatusRepo.Object, _userManager.Object, _adminLogger.Object, _appConfig.Object, _dependencyManager.Object, _security.Object); _deploymentHostManager.Setup(dhm => dhm.GetDeploymentHostAsync(It.IsAny <string>(), It.IsAny <EntityHeader>(), It.IsAny <EntityHeader>(), It.IsAny <bool>())).Returns((string id, EntityHeader user, EntityHeader org, bool throwOnError) => { var instance = GetInstance(); return(Task.FromResult <DeploymentHost>(new DeploymentHost() { CloudProvider = instance.CloudProvider, Size = instance.Size, Subscription = instance.Subscription, ContainerRepository = instance.ContainerRepository, ContainerTag = instance.ContainerTag })); }); }
public DeviceConfigurationManager(IDeviceConfigurationRepo deviceConfigRepo, IDataStreamManager dataStreamManager, IDeviceMessageDefinitionManager deviceMessageDefinitionManager, IPipelineModuleManager pipelineModuleManager, IDeviceAdminManager deviceAdminManager, IAdminLogger logger, IDeploymentInstanceManagerCore deploymentInstnaceManager, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _pipelineModuleManager = pipelineModuleManager; _deviceConfigRepo = deviceConfigRepo; _deviceAdminManager = deviceAdminManager; _deviceMessageDefinitionManager = deviceMessageDefinitionManager; _deploymentInstanceManager = deploymentInstnaceManager; _dataStreamManager = dataStreamManager; }