@@ -64,14 +64,30 @@ public class VectorizerFactory
6464 {
6565 Model = model
6666 // Missing: BaseURL = baseURL
67+ // Also missing: ImageFields, TextFields, VideoFields (no params)
6768 };
6869 }
6970}" ;
7071
71- var expected = VerifyCS
72- . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
73- . WithLocation ( 0 )
74- . WithArguments ( "TestVectorizer" , "BaseURL" ) ;
72+ var expected = new [ ]
73+ {
74+ VerifyCS
75+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
76+ . WithLocation ( 0 )
77+ . WithArguments ( "TestVectorizer" , "BaseURL" ) ,
78+ VerifyCS
79+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
80+ . WithLocation ( 0 )
81+ . WithArguments ( "TestVectorizer" , "ImageFields" ) ,
82+ VerifyCS
83+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
84+ . WithLocation ( 0 )
85+ . WithArguments ( "TestVectorizer" , "TextFields" ) ,
86+ VerifyCS
87+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
88+ . WithLocation ( 0 )
89+ . WithArguments ( "TestVectorizer" , "VideoFields" ) ,
90+ } ;
7591
7692 await VerifyCS . VerifyAnalyzerAsync ( testCode , expected ) ;
7793 }
@@ -90,12 +106,18 @@ public class VectorizerFactory
90106 {
91107 public VectorizerConfig TestVectorizer(
92108 string? model = null,
93- string? baseURL = null
109+ string? baseURL = null,
110+ WeightedFields? imageFields = null,
111+ WeightedFields? textFields = null,
112+ WeightedFields? videoFields = null
94113 ) =>
95114 new Models.Vectorizer.TestVectorizer
96115 {
97116 Model = model,
98- BaseURL = baseURL
117+ BaseURL = baseURL,
118+ ImageFields = imageFields,
119+ TextFields = textFields,
120+ VideoFields = videoFields
99121 };
100122 }
101123}" ;
@@ -116,7 +138,7 @@ namespace Weaviate.Client
116138
117139 public class VectorizerFactory
118140 {
119- public VectorizerConfig TestVectorizer(
141+ public VectorizerConfig {|#0: TestVectorizer|} (
120142 WeightedFields imageFields,
121143 WeightedFields textFields,
122144 WeightedFields videoFields
@@ -126,15 +148,26 @@ WeightedFields videoFields
126148 ImageFields = imageFields,
127149 TextFields = textFields,
128150 VideoFields = videoFields,
129- {|#0 :Weights = VectorizerWeights.FromWeightedFields(imageFields, textFields)|}
151+ {|#1 :Weights = VectorizerWeights.FromWeightedFields(imageFields, textFields)|}
130152 };
131153 }
132154}" ;
133155
134- var expected = VerifyCS
135- . Diagnostic ( VectorizerFactoryAnalyzer . MissingWeightFieldDiagnosticId )
136- . WithLocation ( 0 )
137- . WithArguments ( "TestVectorizer" , "videoFields" ) ;
156+ var expected = new [ ]
157+ {
158+ VerifyCS
159+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingWeightFieldDiagnosticId )
160+ . WithLocation ( 1 )
161+ . WithArguments ( "TestVectorizer" , "videoFields" ) ,
162+ VerifyCS
163+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
164+ . WithLocation ( 0 )
165+ . WithArguments ( "TestVectorizer" , "Model" ) ,
166+ VerifyCS
167+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
168+ . WithLocation ( 0 )
169+ . WithArguments ( "TestVectorizer" , "BaseURL" ) ,
170+ } ;
138171
139172 await VerifyCS . VerifyAnalyzerAsync ( testCode , expected ) ;
140173 }
@@ -155,10 +188,14 @@ public class VectorizerFactory
155188 public VectorizerConfig TestVectorizer(
156189 WeightedFields imageFields,
157190 WeightedFields textFields,
158- WeightedFields videoFields
191+ WeightedFields videoFields,
192+ string? model = null,
193+ string? baseURL = null
159194 ) =>
160195 new Models.Vectorizer.TestVectorizer
161196 {
197+ Model = model,
198+ BaseURL = baseURL,
162199 ImageFields = imageFields,
163200 TextFields = textFields,
164201 VideoFields = videoFields,
@@ -186,10 +223,14 @@ public class VectorizerFactory
186223 public VectorizerConfig TestVectorizer(
187224 WeightedFields imageFields,
188225 WeightedFields textFields,
189- WeightedFields videoFields
226+ WeightedFields videoFields,
227+ string? model = null,
228+ string? baseURL = null
190229 ) =>
191230 new Models.Vectorizer.TestVectorizer
192231 {
232+ Model = model,
233+ BaseURL = baseURL,
193234 ImageFields = imageFields,
194235 TextFields = textFields,
195236 VideoFields = videoFields,
@@ -214,11 +255,19 @@ namespace Weaviate.Client
214255 public class VectorizerFactory
215256 {
216257 public VectorizerConfig TestVectorizer(
217- string? model = null
258+ string? model = null,
259+ string? baseURL = null,
260+ WeightedFields? imageFields = null,
261+ WeightedFields? textFields = null,
262+ WeightedFields? videoFields = null
218263 ) =>
219264 new Models.Vectorizer.TestVectorizer
220265 {
221- Model = model
266+ Model = model,
267+ BaseURL = baseURL,
268+ ImageFields = imageFields,
269+ TextFields = textFields,
270+ VideoFields = videoFields
222271 };
223272 }
224273}" ;
@@ -246,14 +295,30 @@ public class VectorizerFactoryMulti
246295 {
247296 Model = model
248297 // Missing: BaseURL = baseURL
298+ // Also missing: ImageFields, TextFields, VideoFields (no params)
249299 };
250300 }
251301}" ;
252302
253- var expected = VerifyCS
254- . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
255- . WithLocation ( 0 )
256- . WithArguments ( "TestVectorizer" , "BaseURL" ) ;
303+ var expected = new [ ]
304+ {
305+ VerifyCS
306+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
307+ . WithLocation ( 0 )
308+ . WithArguments ( "TestVectorizer" , "BaseURL" ) ,
309+ VerifyCS
310+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
311+ . WithLocation ( 0 )
312+ . WithArguments ( "TestVectorizer" , "ImageFields" ) ,
313+ VerifyCS
314+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
315+ . WithLocation ( 0 )
316+ . WithArguments ( "TestVectorizer" , "TextFields" ) ,
317+ VerifyCS
318+ . Diagnostic ( VectorizerFactoryAnalyzer . MissingPropertyDiagnosticId )
319+ . WithLocation ( 0 )
320+ . WithArguments ( "TestVectorizer" , "VideoFields" ) ,
321+ } ;
257322
258323 await VerifyCS . VerifyAnalyzerAsync ( testCode , expected ) ;
259324 }
0 commit comments