123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package api
- import (
- "testing"
- "github.com/stretchr/testify/assert"
- )
- func TestStructNameWithFullName(t *testing.T) {
- a := API{
- Metadata: Metadata{
- ServiceFullName: "Amazon Service Name-100",
- },
- }
- assert.Equal(t, a.StructName(), "ServiceName100")
- }
- func TestStructNameWithAbbreviation(t *testing.T) {
- a := API{
- Metadata: Metadata{
- ServiceFullName: "AWS Service Name-100",
- ServiceAbbreviation: "AWS SN100",
- },
- }
- assert.Equal(t, a.StructName(), "SN100")
- }
- func TestStructNameForExceptions(t *testing.T) {
- a := API{
- Metadata: Metadata{
- ServiceFullName: "Elastic Load Balancing",
- },
- }
- assert.Equal(t, a.StructName(), "ELB")
- a = API{
- Metadata: Metadata{
- ServiceFullName: "AWS Config",
- },
- }
- assert.Equal(t, a.StructName(), "ConfigService")
- }
|