public DisplayedResourcesHandlerTests() { _mockAWSResourceQueryer = new Mock <IAWSResourceQueryer>(); _cloudApplication = new CloudApplication("StackName", "RecipeId"); _displayedResourcesFactory = new DisplayedResourceCommandFactory(_mockAWSResourceQueryer.Object); _stackResource = new StackResource(); _stackResources = new List <StackResource>() { _stackResource }; _environmentDescription = new EnvironmentDescription(); _loadBalancer = new LoadBalancer(); }
private IEnumerable <Guid> GetInstanceIds(IEnumerable <StackResource> stackResources) { // ReSharper disable once LoopCanBeConvertedToQuery foreach (StackResource ec2Instance in stackResources.Where(x => x.ResourceType == ResourceTypeConstants.Ec2Instance)) { StackResource scopedInstance = ec2Instance; Instance instance = _repositoryInstances.Value.FirstOrDefault(x => x.ResourceId == scopedInstance.PhysicalResourceId); if (instance != null) { yield return(instance.Id); } } }
/// <summary> /// Initializes a new instance of the <see cref="CloudFormationResource"/> class. /// </summary> /// <param name="templateResource">The template resource.</param> /// <param name="stackResource">The stack resource.</param> public CloudFormationResource(IResource templateResource, StackResource stackResource) { this.TemplateResource = templateResource; this.StackResource = stackResource; }