Debian Codegraph @

storage/2019-12-12/table/entities/resource_id_test.go

raw symbols SCIP
1 package entitiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/
2
3 import (
4 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
5
6 "github.com/Azure/go-autorest/autorest/azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/"
7 )
8
9 func TestGetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/TestGetResourceID().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
10 testData := []struct {
11 Environment azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.Environmentscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#
12 Expected string
13 }{
14 {
15 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.ChinaCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/ChinaCloud.,
16 Expected: "https://account1.table.core.chinacloudapi.cn/table1(PartitionKey='partition1',RowKey='row1')",
17 },
18 {
19 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.GermanCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/GermanCloud.,
20 Expected: "https://account1.table.core.cloudapi.de/table1(PartitionKey='partition1',RowKey='row1')",
21 },
22 {
23 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.PublicCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/PublicCloud.,
24 Expected: "https://account1.table.core.windows.net/table1(PartitionKey='partition1',RowKey='row1')",
25 },
26 {
27 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.USGovernmentCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/USGovernmentCloud.,
28 Expected: "https://account1.table.core.usgovcloudapi.net/table1(PartitionKey='partition1',RowKey='row1')",
29 },
30 }
31 for _, v := range testData {
32 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Testing Environment %q", v.Environment.Namescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#Name.)
33 c := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/NewWithEnvironment().(v.Environment)
34 actual := c.GetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/Client#GetResourceID().("account1", "table1", "partition1", "row1")
35 if actual != v.Expected {
36 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Resource ID to be %q but got %q", v.Expected, actual)
37 }
38 }
39 }
40
41 func TestParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/TestParseResourceID().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
42 testData := []struct {
43 Environment azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.Environmentscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#
44 Input string
45 }{
46 {
47 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.ChinaCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/ChinaCloud.,
48 Input: "https://account1.table.core.chinacloudapi.cn/table1(PartitionKey='partition1',RowKey='row1')",
49 },
50 {
51 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.GermanCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/GermanCloud.,
52 Input: "https://account1.table.core.cloudapi.de/table1(PartitionKey='partition1',RowKey='row1')",
53 },
54 {
55 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.PublicCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/PublicCloud.,
56 Input: "https://account1.table.core.windows.net/table1(PartitionKey='partition1',RowKey='row1')",
57 },
58 {
59 Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.USGovernmentCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/USGovernmentCloud.,
60 Input: "https://account1.table.core.usgovcloudapi.net/table1(PartitionKey='partition1',RowKey='row1')",
61 },
62 }
63 for _, v := range testData {
64 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Testing Environment %q", v.Environment.Namescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#Name.)
65 actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ParseResourceID().(v.Input)
66 if err != nil {
67 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
68 }
69
70 if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#AccountName. != "account1" {
71 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Account Name to be `account1` but got %q", actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#AccountName.)
72 }
73 if actual.TableNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#TableName. != "table1" {
74 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Table Name to be `table1` but got %q", actual.TableNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#TableName.)
75 }
76 if actual.PartitionKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#PartitionKey. != "partition1" {
77 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Partition Key to be `partition1` but got %q", actual.PartitionKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#PartitionKey.)
78 }
79 if actual.RowKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#RowKey. != "row1" {
80 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Row Key to be `row1` but got %q", actual.RowKeyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities`/ResourceID#RowKey.)
81 }
82 }
83 }