Slide 20
Slide 20 text
func Test_GetAwsInstanceIds(t *testing.T) {
tests := []struct {
name string
instanceIds []string
}{
{
name: "get all instance IDs",
instanceIds:
[]string{"i-11111", "i-22222", "i-33333"},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
ec2API := &testAwsEc2API{
instanceIds: test.instanceIds,
}
gotInstanceIds := GetAwsInstanceIds(ec2API)
assert.Equal(t, test.instanceIds, gotInstanceIds)
})
}
}