@@ -61,30 +61,28 @@ func TestOperatorResolver(t *testing.T) {
6161 }
6262
6363 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
7069 }{
7170 {
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 ,
7674 SelectedVariables : []deppy.Identifier {"operatorhub/packageA/2.0.0" ,
7775 "operatorhub/prometheus/0.47.0" ,
7876 "required package packageA" ,
7977 "required package prometheus" },
8078 ExpectedError : nil ,
8179 },
8280 {
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 ,
8886 },
8987 {
9088 Name : "should return an error if the entity source throws an error" ,
@@ -109,7 +107,7 @@ func TestOperatorResolver(t *testing.T) {
109107 assert .Equal (t , err , tt .ExpectedError )
110108 assert .Nil (t , solution )
111109 } else {
112- assert .Len (t , solution .SelectedVariables (), tt .SelectedVariableCnt )
110+ assert .Len (t , solution .SelectedVariables (), len ( tt .SelectedVariables ) )
113111 for _ , identifier := range tt .SelectedVariables {
114112 assert .True (t , solution .IsSelected (identifier ))
115113 }
0 commit comments