@@ -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 > { } ,
@@ -91,6 +92,7 @@ public async Task UpdateSettings()
9192 SearchableAttributes = new string [ ] { "name" , "genre" } ,
9293 StopWords = new string [ ] { "of" , "the" } ,
9394 DistinctAttribute = "name" ,
95+ Dictionary = new string [ ] { "dictionary" }
9496 } ;
9597 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettings ) ;
9698 await AssertGetInequality ( _index . GetSettingsAsync , newSettings ) ; // fields omitted in newSettings shouldn't have changed
@@ -110,6 +112,7 @@ public async Task TwoStepUpdateSettings()
110112 { "hp" , new string [ ] { "harry potter" } } ,
111113 { "harry potter" , new string [ ] { "hp" } } ,
112114 } ,
115+ Dictionary = new string [ ] { "dictionary" }
113116 } ;
114117 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettingsOne ) ;
115118
@@ -139,7 +142,8 @@ public async Task ResetSettings()
139142 DistinctAttribute = "name" ,
140143 DisplayedAttributes = new string [ ] { "name" } ,
141144 RankingRules = new string [ ] { "typo" } ,
142- FilterableAttributes = new string [ ] { "genre" }
145+ FilterableAttributes = new string [ ] { "genre" } ,
146+ Dictionary = new string [ ] { "dictionary" }
143147 } ;
144148 await AssertUpdateSuccess ( _index . UpdateSettingsAsync , newSettings ) ;
145149 await AssertGetInequality ( _index . GetSettingsAsync , newSettings ) ; // fields omitted in newSettings shouldn't have changed
@@ -591,11 +595,37 @@ public async Task ResetProximityPrecision()
591595 await AssertUpdateSuccess ( _index . UpdateProximityPrecisionAsync , newPrecision ) ;
592596 await AssertGetEquality ( _index . GetProximityPrecisionAsync , newPrecision ) ;
593597
594- await AssertResetSuccess ( _index . ResetProximityPrecisionAsync
595- ) ;
598+ await AssertResetSuccess ( _index . ResetProximityPrecisionAsync ) ;
596599 await AssertGetEquality ( _index . GetProximityPrecisionAsync , _defaultSettings . ProximityPrecision ) ;
597600 }
598601
602+ [ Fact ]
603+ public async Task GetDictionaryAsync ( )
604+ {
605+ await AssertGetEquality ( _index . GetDictionaryAsync , _defaultSettings . Dictionary ) ;
606+ }
607+
608+ [ Fact ]
609+ public async Task UpdateDictionaryAsync ( )
610+ {
611+ var newDictionary = new string [ ] { "W. E. B." , "W.E.B." } ;
612+
613+ await AssertUpdateSuccess ( _index . UpdateDictionaryAsync , newDictionary ) ;
614+ await AssertGetEquality ( _index . GetDictionaryAsync , newDictionary ) ;
615+ }
616+
617+ [ Fact ]
618+ public async Task ResetDictionaryAsync ( )
619+ {
620+ var newDictionary = new string [ ] { "W. E. B." , "W.E.B." } ;
621+
622+ await AssertUpdateSuccess ( _index . UpdateDictionaryAsync , newDictionary ) ;
623+ await AssertGetEquality ( _index . GetDictionaryAsync , newDictionary ) ;
624+
625+ await AssertResetSuccess ( _index . ResetDictionaryAsync ) ;
626+ await AssertGetEquality ( _index . GetDictionaryAsync , _defaultSettings . Dictionary ) ;
627+ }
628+
599629 private static Settings SettingsWithDefaultedNullFields ( Settings inputSettings , Settings defaultSettings )
600630 {
601631 return new Settings
@@ -613,7 +643,8 @@ private static Settings SettingsWithDefaultedNullFields(Settings inputSettings,
613643 TypoTolerance = inputSettings . TypoTolerance ?? defaultSettings . TypoTolerance ,
614644 Faceting = inputSettings . Faceting ?? defaultSettings . Faceting ,
615645 Pagination = inputSettings . Pagination ?? defaultSettings . Pagination ,
616- ProximityPrecision = inputSettings . ProximityPrecision ?? defaultSettings . ProximityPrecision
646+ ProximityPrecision = inputSettings . ProximityPrecision ?? defaultSettings . ProximityPrecision ,
647+ Dictionary = inputSettings . Dictionary ?? defaultSettings . Dictionary ,
617648 } ;
618649 }
619650
0 commit comments