@@ -28,28 +28,28 @@ import (
2828
2929func TestCacheGet (t * testing.T ) {
3030 cases := map [string ]struct {
31- sku string
32- kind Kind
33- have []compute.ResourceSku
34- err string
31+ sku string
32+ resourceType ResourceType
33+ have []compute.ResourceSku
34+ err string
3535 }{
3636 "should find" : {
37- sku : "foo" ,
38- kind : "bar" ,
37+ sku : "foo" ,
38+ resourceType : "bar" ,
3939 have : []compute.ResourceSku {
4040 {
41- Name : to .StringPtr ("other" ),
42- Kind : to .StringPtr ("baz" ),
41+ Name : to .StringPtr ("other" ),
42+ ResourceType : to .StringPtr ("baz" ),
4343 },
4444 {
45- Name : to .StringPtr ("foo" ),
46- Kind : to .StringPtr ("bar" ),
45+ Name : to .StringPtr ("foo" ),
46+ ResourceType : to .StringPtr ("bar" ),
4747 },
4848 },
4949 },
5050 "should not find" : {
51- sku : "foo" ,
52- kind : "bar" ,
51+ sku : "foo" ,
52+ resourceType : "bar" ,
5353 have : []compute.ResourceSku {
5454 {
5555 Name : to .StringPtr ("other" ),
@@ -68,7 +68,7 @@ func TestCacheGet(t *testing.T) {
6868 data : tc .have ,
6969 }
7070
71- val , err := cache .Get (context .Background (), tc .sku , tc .kind )
71+ val , err := cache .Get (context .Background (), tc .sku , tc .resourceType )
7272 if tc .err != "" {
7373 if err == nil {
7474 t .Fatalf ("expected cache.get to fail with error %s, but actual error was nil" , tc .err )
@@ -86,12 +86,12 @@ func TestCacheGet(t *testing.T) {
8686 if * val .Name != tc .sku {
8787 t .Fatalf ("expected name to be %s, but was %s" , tc .sku , * val .Name )
8888 }
89- if val .Kind == nil {
89+ if val .ResourceType == nil {
9090 t .Fatalf ("expected name to be %s, but was nil" , tc .sku )
9191 return
9292 }
93- if * val .Kind != string (tc .kind ) {
94- t .Fatalf ("expected kind to be %s, but was %s" , tc .kind , * val .Kind )
93+ if * val .ResourceType != string (tc .resourceType ) {
94+ t .Fatalf ("expected kind to be %s, but was %s" , tc .resourceType , * val .ResourceType )
9595 }
9696 }
9797
@@ -107,8 +107,8 @@ func TestCacheGetZones(t *testing.T) {
107107 "should find 1 result" : {
108108 have : []compute.ResourceSku {
109109 {
110- Name : to .StringPtr ("foo" ),
111- Kind : to .StringPtr (string (VirtualMachines )),
110+ Name : to .StringPtr ("foo" ),
111+ ResourceType : to .StringPtr (string (VirtualMachines )),
112112 Locations : & []string {
113113 "baz" ,
114114 },
@@ -125,8 +125,8 @@ func TestCacheGetZones(t *testing.T) {
125125 "should find 2 results" : {
126126 have : []compute.ResourceSku {
127127 {
128- Name : to .StringPtr ("foo" ),
129- Kind : to .StringPtr (string (VirtualMachines )),
128+ Name : to .StringPtr ("foo" ),
129+ ResourceType : to .StringPtr (string (VirtualMachines )),
130130 Locations : & []string {
131131 "baz" ,
132132 },
@@ -138,8 +138,8 @@ func TestCacheGetZones(t *testing.T) {
138138 },
139139 },
140140 {
141- Name : to .StringPtr ("foo" ),
142- Kind : to .StringPtr (string (VirtualMachines )),
141+ Name : to .StringPtr ("foo" ),
142+ ResourceType : to .StringPtr (string (VirtualMachines )),
143143 Locations : & []string {
144144 "baz" ,
145145 },
@@ -156,8 +156,8 @@ func TestCacheGetZones(t *testing.T) {
156156 "should not find due to location mismatch" : {
157157 have : []compute.ResourceSku {
158158 {
159- Name : to .StringPtr ("foo" ),
160- Kind : to .StringPtr (string (VirtualMachines )),
159+ Name : to .StringPtr ("foo" ),
160+ ResourceType : to .StringPtr (string (VirtualMachines )),
161161 Locations : & []string {
162162 "foobar" ,
163163 },
@@ -174,8 +174,8 @@ func TestCacheGetZones(t *testing.T) {
174174 "should not find due to location restriction" : {
175175 have : []compute.ResourceSku {
176176 {
177- Name : to .StringPtr ("foo" ),
178- Kind : to .StringPtr (string (VirtualMachines )),
177+ Name : to .StringPtr ("foo" ),
178+ ResourceType : to .StringPtr (string (VirtualMachines )),
179179 Locations : & []string {
180180 "baz" ,
181181 },
@@ -198,8 +198,8 @@ func TestCacheGetZones(t *testing.T) {
198198 "should not find due to zone restriction" : {
199199 have : []compute.ResourceSku {
200200 {
201- Name : to .StringPtr ("foo" ),
202- Kind : to .StringPtr (string (VirtualMachines )),
201+ Name : to .StringPtr ("foo" ),
202+ ResourceType : to .StringPtr (string (VirtualMachines )),
203203 Locations : & []string {
204204 "baz" ,
205205 },
@@ -251,8 +251,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
251251 "should find 1 result" : {
252252 have : []compute.ResourceSku {
253253 {
254- Name : to .StringPtr ("foo" ),
255- Kind : to .StringPtr (string (VirtualMachines )),
254+ Name : to .StringPtr ("foo" ),
255+ ResourceType : to .StringPtr (string (VirtualMachines )),
256256 Locations : & []string {
257257 "baz" ,
258258 },
@@ -269,8 +269,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
269269 "should find 2 results" : {
270270 have : []compute.ResourceSku {
271271 {
272- Name : to .StringPtr ("foo" ),
273- Kind : to .StringPtr (string (VirtualMachines )),
272+ Name : to .StringPtr ("foo" ),
273+ ResourceType : to .StringPtr (string (VirtualMachines )),
274274 Locations : & []string {
275275 "baz" ,
276276 },
@@ -287,8 +287,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
287287 "should not find due to size mismatch" : {
288288 have : []compute.ResourceSku {
289289 {
290- Name : to .StringPtr ("foobar" ),
291- Kind : to .StringPtr (string (VirtualMachines )),
290+ Name : to .StringPtr ("foobar" ),
291+ ResourceType : to .StringPtr (string (VirtualMachines )),
292292 Locations : & []string {
293293 "baz" ,
294294 },
@@ -305,8 +305,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
305305 "should not find due to location mismatch" : {
306306 have : []compute.ResourceSku {
307307 {
308- Name : to .StringPtr ("foo" ),
309- Kind : to .StringPtr (string (VirtualMachines )),
308+ Name : to .StringPtr ("foo" ),
309+ ResourceType : to .StringPtr (string (VirtualMachines )),
310310 Locations : & []string {
311311 "foobar" ,
312312 },
@@ -323,8 +323,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
323323 "should not find due to location restriction" : {
324324 have : []compute.ResourceSku {
325325 {
326- Name : to .StringPtr ("foo" ),
327- Kind : to .StringPtr (string (VirtualMachines )),
326+ Name : to .StringPtr ("foo" ),
327+ ResourceType : to .StringPtr (string (VirtualMachines )),
328328 Locations : & []string {
329329 "baz" ,
330330 },
@@ -347,8 +347,8 @@ func TestCacheGetZonesWithVMSize(t *testing.T) {
347347 "should not find due to zone restriction" : {
348348 have : []compute.ResourceSku {
349349 {
350- Name : to .StringPtr ("foo" ),
351- Kind : to .StringPtr (string (VirtualMachines )),
350+ Name : to .StringPtr ("foo" ),
351+ ResourceType : to .StringPtr (string (VirtualMachines )),
352352 Locations : & []string {
353353 "baz" ,
354354 },
0 commit comments