forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_factory_test.go
40 lines (36 loc) · 1.17 KB
/
data_factory_test.go
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
package azurerm
import "testing"
func TestAzureRmDataFactoryLinkedServiceConnectionStringDiff(t *testing.T) {
cases := []struct {
Old string
New string
NoDiff bool
}{
{
Old: "",
New: "",
NoDiff: true,
},
{
Old: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test",
New: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test",
NoDiff: true,
},
{
Old: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test",
New: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test",
NoDiff: true,
},
{
Old: "Integrated Security=False;Data Source=test2;Initial Catalog=test;User ID=test",
New: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test",
NoDiff: false,
},
}
for _, tc := range cases {
noDiff := azureRmDataFactoryLinkedServiceConnectionStringDiff("", tc.Old, tc.New, nil)
if noDiff != tc.NoDiff {
t.Fatalf("Expected azureRmDataFactoryLinkedServiceConnectionStringDiff to be '%t' for '%s' '%s' - got '%t'", tc.NoDiff, tc.Old, tc.New, noDiff)
}
}
}