8
8
)
9
9
10
10
func TestNewUnifiedClassificationService (t * testing.T ) {
11
- // Test with nil unified classifier (this is expected to work)
11
+ // Test with nil unified classifier and nil legacy classifier (this is expected to work)
12
12
config := & config.RouterConfig {}
13
- service := NewUnifiedClassificationService (nil , config )
13
+ service := NewUnifiedClassificationService (nil , nil , config )
14
14
15
15
if service == nil {
16
16
t .Error ("Expected non-nil service" )
@@ -26,6 +26,28 @@ func TestNewUnifiedClassificationService(t *testing.T) {
26
26
}
27
27
}
28
28
29
+ func TestNewUnifiedClassificationService_WithBothClassifiers (t * testing.T ) {
30
+ // Test with both unified and legacy classifiers
31
+ config := & config.RouterConfig {}
32
+ unifiedClassifier := & classification.UnifiedClassifier {}
33
+ legacyClassifier := & classification.Classifier {}
34
+
35
+ service := NewUnifiedClassificationService (unifiedClassifier , legacyClassifier , config )
36
+
37
+ if service == nil {
38
+ t .Error ("Expected non-nil service" )
39
+ }
40
+ if service .classifier != legacyClassifier {
41
+ t .Error ("Expected legacy classifier to match provided classifier" )
42
+ }
43
+ if service .unifiedClassifier != unifiedClassifier {
44
+ t .Error ("Expected unified classifier to match provided classifier" )
45
+ }
46
+ if service .config != config {
47
+ t .Error ("Expected config to match" )
48
+ }
49
+ }
50
+
29
51
func TestClassificationService_HasUnifiedClassifier (t * testing.T ) {
30
52
t .Run ("No_classifier" , func (t * testing.T ) {
31
53
service := & ClassificationService {
0 commit comments