File: api_test.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.1.14%2Bdfsg-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 25,052 kB
  • sloc: ruby: 193; makefile: 98
file content (42 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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")
}