@@ -61,30 +61,28 @@ func TestOperatorResolver(t *testing.T) {
61
61
}
62
62
63
63
for _ , tt := range []struct {
64
- Name string
65
- Client client.Client
66
- EntitySource input.EntitySource
67
- SelectedVariableCnt int
68
- SelectedVariables []deppy.Identifier
69
- ExpectedError error
64
+ Name string
65
+ Client client.Client
66
+ EntitySource input.EntitySource
67
+ SelectedVariables []deppy.Identifier
68
+ ExpectedError error
70
69
}{
71
70
{
72
- Name : "should resolve the packages described by the available Operator resources" ,
73
- Client : FakeClient (testResource ... ),
74
- EntitySource : testEntitySource ,
75
- SelectedVariableCnt : 4 ,
71
+ Name : "should resolve the packages described by the available Operator resources" ,
72
+ Client : FakeClient (testResource ... ),
73
+ EntitySource : testEntitySource ,
76
74
SelectedVariables : []deppy.Identifier {"operatorhub/packageA/2.0.0" ,
77
75
"operatorhub/prometheus/0.47.0" ,
78
76
"required package packageA" ,
79
77
"required package prometheus" },
80
78
ExpectedError : nil ,
81
79
},
82
80
{
83
- Name : "should not return an error if there are no Operator resources" ,
84
- Client : FakeClient (),
85
- EntitySource : testEntitySource ,
86
- SelectedVariableCnt : 0 ,
87
- ExpectedError : nil ,
81
+ Name : "should not return an error if there are no Operator resources" ,
82
+ Client : FakeClient (),
83
+ EntitySource : testEntitySource ,
84
+ SelectedVariables : []deppy. Identifier {} ,
85
+ ExpectedError : nil ,
88
86
},
89
87
{
90
88
Name : "should return an error if the entity source throws an error" ,
@@ -109,7 +107,7 @@ func TestOperatorResolver(t *testing.T) {
109
107
assert .Equal (t , err , tt .ExpectedError )
110
108
assert .Nil (t , solution )
111
109
} else {
112
- assert .Len (t , solution .SelectedVariables (), tt .SelectedVariableCnt )
110
+ assert .Len (t , solution .SelectedVariables (), len ( tt .SelectedVariables ) )
113
111
for _ , identifier := range tt .SelectedVariables {
114
112
assert .True (t , solution .IsSelected (identifier ))
115
113
}
0 commit comments