Esempio n. 1
0
        public void GetStackByName()
        {
            // Arrange
            const string stackName = "three";
            var          response  = new DescribeStacksResponse
            {
                Stacks = new List <Stack>
                {
                    new Stack {
                        StackName = stackName
                    }
                }
            };

            CloudFormationMock.Setup(x => x.DescribeStacks(It.Is <DescribeStacksRequest>(y => y.StackName == stackName))).Returns(response);

            // Act
            var stack = StackService.GetStack("three");

            // Assert
            stack.StackName.Should().Be(stackName);
        }
Esempio n. 2
0
        public void GetAllStacks()
        {
            // Arrange
            var response = new DescribeStacksResponse
            {
                Stacks = new List <Stack>
                {
                    new Stack {
                        StackId = "one"
                    },
                    new Stack {
                        StackId = "two"
                    }
                }
            };

            CloudFormationMock.Setup(x => x.DescribeStacks()).Returns(response);

            // Act
            IEnumerable <Stack> stacks = StackService.GetAllStacks();

            // Assert
            stacks.Select(x => x.StackId).ShouldBeEquivalentTo(response.Stacks.Select(y => y.StackId));
        }