@@ -34,6 +34,7 @@ public SettingsTests(TFixture fixture)
3434 DistinctAttribute = null ,
3535 SearchableAttributes = new string [ ] { "*" } ,
3636 DisplayedAttributes = new string [ ] { "*" } ,
37+ Dictionary = new string [ ] { } ,
3738 StopWords = new string [ ] { } ,
3839 SeparatorTokens = new List < string > { } ,
3940 NonSeparatorTokens = new List < string > { } ,
@@ -95,6 +96,7 @@ public async Task UpdateSettings()
9596 SearchableAttributes = new string [ ] { "name" , "genre" } ,
9697 StopWords = new string [ ] { "of" , "the" } ,
9798 DistinctAttribute = "name" ,
99+ Dictionary = new string [ ] { "dictionary" }
98100 } ;
99101 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettings ) ;
100102 await AssertGetInequality ( _index . GetSettingsAsync , newSettings ) ; // fields omitted in newSettings shouldn't have changed
@@ -114,6 +116,7 @@ public async Task TwoStepUpdateSettings()
114116 { "hp" , new string [ ] { "harry potter" } } ,
115117 { "harry potter" , new string [ ] { "hp" } } ,
116118 } ,
119+ Dictionary = new string [ ] { "dictionary" }
117120 } ;
118121 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettingsOne ) ;
119122
@@ -143,7 +146,8 @@ public async Task ResetSettings()
143146 DistinctAttribute = "name" ,
144147 DisplayedAttributes = new string [ ] { "name" } ,
145148 RankingRules = new string [ ] { "typo" } ,
146- FilterableAttributes = new string [ ] { "genre" }
149+ FilterableAttributes = new string [ ] { "genre" } ,
150+ Dictionary = new string [ ] { "dictionary" }
147151 } ;
148152 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettings ) ;
149153 await AssertGetInequality ( _index . GetSettingsAsync , newSettings ) ; // fields omitted in newSettings shouldn't have changed
@@ -603,11 +607,37 @@ public async Task ResetProximityPrecision()
603607 await AssertUpdateSuccess ( _index . UpdateProximityPrecisionAsync , newPrecision ) ;
604608 await AssertGetEquality ( _index . GetProximityPrecisionAsync , newPrecision ) ;
605609
606- await AssertResetSuccess ( _index . ResetProximityPrecisionAsync
607- ) ;
610+ await AssertResetSuccess ( _index . ResetProximityPrecisionAsync ) ;
608611 await AssertGetEquality ( _index . GetProximityPrecisionAsync , _defaultSettings . ProximityPrecision ) ;
609612 }
610613
614+ [ Fact ]
615+ public async Task GetDictionaryAsync ( )
616+ {
617+ await AssertGetEquality ( _index . GetDictionaryAsync , _defaultSettings . Dictionary ) ;
618+ }
619+
620+ [ Fact ]
621+ public async Task UpdateDictionaryAsync ( )
622+ {
623+ var newDictionary = new string [ ] { "W. E. B." , "W.E.B." } ;
624+
625+ await AssertUpdateSuccess ( _index . UpdateDictionaryAsync , newDictionary ) ;
626+ await AssertGetEquality ( _index . GetDictionaryAsync , newDictionary ) ;
627+ }
628+
629+ [ Fact ]
630+ public async Task ResetDictionaryAsync ( )
631+ {
632+ var newDictionary = new string [ ] { "W. E. B." , "W.E.B." } ;
633+
634+ await AssertUpdateSuccess ( _index . UpdateDictionaryAsync , newDictionary ) ;
635+ await AssertGetEquality ( _index . GetDictionaryAsync , newDictionary ) ;
636+
637+ await AssertResetSuccess ( _index . ResetDictionaryAsync ) ;
638+ await AssertGetEquality ( _index . GetDictionaryAsync , _defaultSettings . Dictionary ) ;
639+ }
640+
611641 private static Settings SettingsWithDefaultedNullFields ( Settings inputSettings , Settings defaultSettings )
612642 {
613643 return new Settings
@@ -625,7 +655,8 @@ private static Settings SettingsWithDefaultedNullFields(Settings inputSettings,
625655 TypoTolerance = inputSettings . TypoTolerance ?? defaultSettings . TypoTolerance ,
626656 Faceting = inputSettings . Faceting ?? defaultSettings . Faceting ,
627657 Pagination = inputSettings . Pagination ?? defaultSettings . Pagination ,
628- ProximityPrecision = inputSettings . ProximityPrecision ?? defaultSettings . ProximityPrecision
658+ ProximityPrecision = inputSettings . ProximityPrecision ?? defaultSettings . ProximityPrecision ,
659+ Dictionary = inputSettings . Dictionary ?? defaultSettings . Dictionary ,
629660 } ;
630661 }
631662
0 commit comments