Skip to content

Commit 17d87e1

Browse files
committed
Applied: dotnet format
1 parent aae878b commit 17d87e1

26 files changed

+89
-80
lines changed

src/Algolia.Search.Test/EndToEnd/Account/AccountCopyIndexTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public async Task TestAccountCopyIndex()
6262
SearchIndex index1 = BaseTest.SearchClient.InitIndex(indexOneName);
6363
SearchIndex index2 = BaseTest.SearchClient2.InitIndex(indexTwoName);
6464

65-
var objectToAdd = new AccountCopyObject {ObjectID = "one"};
65+
var objectToAdd = new AccountCopyObject { ObjectID = "one" };
6666
var addObject = index1.SaveObjectAsync(objectToAdd);
6767

6868
Rule ruleToSave = new Rule
6969
{
7070
ObjectID = "one",
71-
Condition = new Condition {Anchoring = "is", Pattern = "pattern"},
71+
Condition = new Condition { Anchoring = "is", Pattern = "pattern" },
7272
Consequence = new Consequence
7373
{
7474
Params = new ConsequenceParams
@@ -90,14 +90,14 @@ public async Task TestAccountCopyIndex()
9090
{
9191
ObjectID = "one",
9292
Type = SynonymType.Synonym,
93-
Synonyms = new List<string> {"one", "two"}
93+
Synonyms = new List<string> { "one", "two" }
9494
};
9595

9696
var saveSynonym = index1.SaveSynonymAsync(synonym);
9797

9898
IndexSettings settings = new IndexSettings
9999
{
100-
AttributesForFaceting = new List<string> {"company"}
100+
AttributesForFaceting = new List<string> { "company" }
101101
};
102102

103103
var saveSettings = index1.SetSettingsAsync(settings);

src/Algolia.Search.Test/EndToEnd/Client/CopyIndexTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public async Task TestCopyIndex()
8484

8585
IndexSettings settings = new IndexSettings
8686
{
87-
AttributesForFaceting = new List<string> {"company"}
87+
AttributesForFaceting = new List<string> { "company" }
8888
};
8989

9090
var setSettings = _sourceIndex.SetSettingsAsync(settings);
@@ -94,15 +94,15 @@ public async Task TestCopyIndex()
9494
ObjectID = "google_placeholder",
9595
Type = SynonymType.Placeholder,
9696
Placeholder = "<GOOG>",
97-
Replacements = new List<string> {"Google", "GOOG"}
97+
Replacements = new List<string> { "Google", "GOOG" }
9898
};
9999

100100
var saveSynonyms = _sourceIndex.SaveSynonymAsync(synonym);
101101

102102
Rule ruleToSave = new Rule
103103
{
104104
ObjectID = "company_automatic_faceting",
105-
Condition = new Condition {Anchoring = "contains", Pattern = "{facet:company}"},
105+
Condition = new Condition { Anchoring = "contains", Pattern = "{facet:company}" },
106106
Consequence = new Consequence
107107
{
108108
Params = new ConsequenceParams

src/Algolia.Search.Test/EndToEnd/Index/MultiClusterManagementTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task McmTest()
5050

5151
SearchResponse<UserIdResponse> searchResponse =
5252
await BaseTest.McmClient.SearchUserIDsAsync(new SearchUserIdsRequest
53-
{Query = userId, Cluster = listClusters.ElementAt(0).ClusterName});
53+
{ Query = userId, Cluster = listClusters.ElementAt(0).ClusterName });
5454
Assert.True(searchResponse.NbHits == 1);
5555

5656
ListUserIdsResponse listUserIds = await BaseTest.McmClient.ListUserIdsAsync();
@@ -70,7 +70,7 @@ await BaseTest.McmClient.SearchUserIDsAsync(new SearchUserIdsRequest
7070
userIdsToRemove.Select(x => BaseTest.McmClient.RemoveUserIdAsync(x.UserID)).ToArray();
7171
await Task.WhenAll(delete);
7272
}
73-
73+
7474
private void WaitUserId(string userId)
7575
{
7676
while (true)
@@ -94,7 +94,7 @@ private void WaitUserId(string userId)
9494
break;
9595
}
9696
}
97-
97+
9898
private void RemoveUserId(String userId)
9999
{
100100
RemoveUserIdResponse deleteResponse;

src/Algolia.Search.Test/EndToEnd/Index/QueryRulesTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public void Init()
5050
public async Task RulesTest()
5151
{
5252
// Set attributesForFaceting to [“brand”] using setSettings and collect the taskID
53-
IndexSettings settings = new IndexSettings {AttributesForFaceting = new List<string> {"brand"}};
53+
IndexSettings settings = new IndexSettings { AttributesForFaceting = new List<string> { "brand" } };
5454
var setSettingsResponse = await _index.SetSettingsAsync(settings);
5555
setSettingsResponse.Wait();
5656

5757
Rule ruleToSave = new Rule
5858
{
5959
ObjectID = "brand_automatic_faceting",
6060
Enabled = false,
61-
Condition = new Condition {Anchoring = "is", Pattern = "{facet:brand}"},
61+
Condition = new Condition { Anchoring = "is", Pattern = "{facet:brand}" },
6262
Consequence = new Consequence
6363
{
6464
Params = new ConsequenceParams
@@ -90,7 +90,7 @@ public async Task RulesTest()
9090
Rule ruleToSave2 = new Rule
9191
{
9292
ObjectID = "query_edits",
93-
Condition = new Condition {Anchoring = "is", Pattern = "mobile phone"},
93+
Condition = new Condition { Anchoring = "is", Pattern = "mobile phone" },
9494
Consequence = new Consequence
9595
{
9696
Params = new ConsequenceParams
@@ -107,7 +107,7 @@ public async Task RulesTest()
107107
},
108108
};
109109

110-
var batchRulesResponse = await _index.SaveRulesAsync(new List<Rule> {ruleToSave2});
110+
var batchRulesResponse = await _index.SaveRulesAsync(new List<Rule> { ruleToSave2 });
111111

112112
saveRuleResponse.Wait();
113113
batchRulesResponse.Wait();

src/Algolia.Search.Test/EndToEnd/Index/ReplacingTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ public void Init()
4747
[Test]
4848
public async Task TestReplacing()
4949
{
50-
var addResponse = _index.SaveObjectAsync(new ReplaceAllTestObject {ObjectID = "one"});
50+
var addResponse = _index.SaveObjectAsync(new ReplaceAllTestObject { ObjectID = "one" });
5151

5252
var ruleToSave = new Rule
5353
{
5454
ObjectID = "one",
55-
Condition = new Condition {Anchoring = "is", Pattern = "pattern"},
55+
Condition = new Condition { Anchoring = "is", Pattern = "pattern" },
5656
Consequence = new Consequence
5757
{
5858
Params = new ConsequenceParams
5959
{
6060
Query = new ConsequenceQuery
6161
{
62-
Edits = new List<Edit> {new Edit {Type = EditType.Remove, Delete = "pattern"}}
62+
Edits = new List<Edit> { new Edit { Type = EditType.Remove, Delete = "pattern" } }
6363
}
6464
}
6565
}
@@ -71,7 +71,7 @@ public async Task TestReplacing()
7171
{
7272
ObjectID = "one",
7373
Type = SynonymType.Synonym,
74-
Synonyms = new List<string> {"one", "two"}
74+
Synonyms = new List<string> { "one", "two" }
7575
};
7676

7777
var saveSynonymResponse = _index.SaveSynonymAsync(synonymToSave);
@@ -92,29 +92,29 @@ public async Task TestReplacing()
9292
var ruleToSave2 = new Rule
9393
{
9494
ObjectID = "two",
95-
Condition = new Condition {Anchoring = "is", Pattern = "pattern"},
95+
Condition = new Condition { Anchoring = "is", Pattern = "pattern" },
9696
Consequence = new Consequence
9797
{
9898
Params = new ConsequenceParams
9999
{
100100
Query = new ConsequenceQuery
101101
{
102-
Edits = new List<Edit> {new Edit {Type = EditType.Remove, Delete = "pattern"}}
102+
Edits = new List<Edit> { new Edit { Type = EditType.Remove, Delete = "pattern" } }
103103
}
104104
}
105105
}
106106
};
107107

108-
var replaceAllRulesResponse = await _index.ReplaceAllRulesAsync(new List<Rule> {ruleToSave2});
108+
var replaceAllRulesResponse = await _index.ReplaceAllRulesAsync(new List<Rule> { ruleToSave2 });
109109

110110
var synonymToSave2 = new Synonym
111111
{
112112
ObjectID = "two",
113113
Type = SynonymType.Synonym,
114-
Synonyms = new List<string> {"one", "two"}
114+
Synonyms = new List<string> { "one", "two" }
115115
};
116116

117-
var replaceAllSynonymsResponse = await _index.ReplaceAllSynonymsAsync(new List<Synonym> {synonymToSave2});
117+
var replaceAllSynonymsResponse = await _index.ReplaceAllSynonymsAsync(new List<Synonym> { synonymToSave2 });
118118

119119
replaceAllRulesResponse.Wait();
120120
replaceAllSynonymsResponse.Wait();

src/Algolia.Search.Test/EndToEnd/Index/SynonymsTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public async Task SynonymsOperationsTest()
7171
{
7272
ObjectID = "gba",
7373
Type = SynonymType.Synonym,
74-
Synonyms = new List<string> {"gba", "gameboy advance", "game boy advance"}
74+
Synonyms = new List<string> { "gba", "gameboy advance", "game boy advance" }
7575
};
7676

7777
var regularSynonymResponse = await _index.SaveSynonymAsync(gba);
@@ -81,34 +81,34 @@ public async Task SynonymsOperationsTest()
8181
ObjectID = "wii_to_wii_u",
8282
Type = SynonymType.OneWaySynonym,
8383
Input = "wii",
84-
Synonyms = new List<string> {"wii u"}
84+
Synonyms = new List<string> { "wii u" }
8585
};
8686

8787
Synonym playstationPlaceholder = new Synonym
8888
{
8989
ObjectID = "playstation_version_placeholder",
9090
Type = SynonymType.Placeholder,
9191
Placeholder = "<PLAYSTATIONVERSION>",
92-
Replacements = new List<string> {"1", "One", "2", "3", "4", "4 Pro"}
92+
Replacements = new List<string> { "1", "One", "2", "3", "4", "4 Pro" }
9393
};
9494

9595
Synonym ps4 = new Synonym
9696
{
9797
ObjectID = "ps4",
9898
Type = SynonymType.AltCorrection1,
9999
Word = "ps4",
100-
Corrections = new List<string> {"playstation4"}
100+
Corrections = new List<string> { "playstation4" }
101101
};
102102

103103
Synonym psone = new Synonym
104104
{
105105
ObjectID = "psone",
106106
Type = SynonymType.AltCorrection2,
107107
Word = "psone",
108-
Corrections = new List<string> {"playstationone"}
108+
Corrections = new List<string> { "playstationone" }
109109
};
110110

111-
List<Synonym> synonyms = new List<Synonym> {wiiToWiiu, playstationPlaceholder, ps4, psone};
111+
List<Synonym> synonyms = new List<Synonym> { wiiToWiiu, playstationPlaceholder, ps4, psone };
112112

113113
var saveSynonymsResponse = await _index.SaveSynonymsAsync(synonyms);
114114

@@ -131,7 +131,7 @@ public async Task SynonymsOperationsTest()
131131

132132
// Perform a synonym search using searchSynonyms with an empty query, page 0 and hitsPerPage set to 10 and check that the returned synonyms are the same as the 5 originally saved
133133
SearchResponse<Synonym> searchResponse =
134-
await _index.SearchSynonymsAsync(new SynonymQuery {HitsPerPage = 10, Page = 0});
134+
await _index.SearchSynonymsAsync(new SynonymQuery { HitsPerPage = 10, Page = 0 });
135135
Assert.True(searchResponse.Hits.Count == 5);
136136

137137
// Instantiate a new SynonymIterator using newSynonymIterator and iterate over all the synonyms and check that those collected synonyms are the same as the 5 originally saved
@@ -164,7 +164,7 @@ public async Task SynonymsOperationsTest()
164164

165165
// Perform a synonym search using searchSynonyms with an empty query, page 0 and hitsPerPage set to 10 and check that the number of returned synonyms is equal to 0
166166
SearchResponse<Synonym> searchAfterClearResponse =
167-
await _index.SearchSynonymsAsync(new SynonymQuery {HitsPerPage = 10, Page = 0});
167+
await _index.SearchSynonymsAsync(new SynonymQuery { HitsPerPage = 10, Page = 0 });
168168
Assert.True(searchAfterClearResponse.Hits.Count == 0);
169169
}
170170

src/Algolia.Search.Test/EndToEnd/Insights/InsightsTest.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ public void TestInsights()
4949
var insights = insightsClient.User("test");
5050

5151
// click
52-
insights.ClickedFilters("clickedFilters", _indexName, new List<string> {"brand:apple"});
53-
insights.ClickedObjectIDs("clickedObjectEvent", _indexName, new List<string> {"1", "2"});
52+
insights.ClickedFilters("clickedFilters", _indexName, new List<string> { "brand:apple" });
53+
insights.ClickedObjectIDs("clickedObjectEvent", _indexName, new List<string> { "1", "2" });
5454

5555
// Conversion
56-
insights.ConvertedObjectIDs("convertedObjectIDs", _indexName, new List<string> {"1", "2"});
57-
insights.ConvertedFilters("converterdFilters", _indexName, new List<string> {"brand:apple"});
56+
insights.ConvertedObjectIDs("convertedObjectIDs", _indexName, new List<string> { "1", "2" });
57+
insights.ConvertedFilters("converterdFilters", _indexName, new List<string> { "brand:apple" });
5858

5959
// View
60-
insights.ViewedFilters("viewedFilters", _indexName, new List<string> {"brand:apple", "brand:google"});
61-
insights.ViewedObjectIDs("viewedObjectIDs", _indexName, new List<string> {"1", "2"});
60+
insights.ViewedFilters("viewedFilters", _indexName, new List<string> { "brand:apple", "brand:google" });
61+
insights.ViewedObjectIDs("viewedObjectIDs", _indexName, new List<string> { "1", "2" });
6262

63-
_index.SaveObject(new AlgoliaStub {ObjectID = "one"}).Wait();
63+
_index.SaveObject(new AlgoliaStub { ObjectID = "one" }).Wait();
6464

6565
var query = new Query()
6666
{
@@ -69,12 +69,12 @@ public void TestInsights()
6969
};
7070

7171
var search1 = _index.Search<AlgoliaStub>(query);
72-
insights.ClickedObjectIDsAfterSearch("clickedObjectIDsAfterSearch", _indexName, new List<string> {"1", "2"},
73-
new List<uint> {17, 19}, search1.QueryID);
72+
insights.ClickedObjectIDsAfterSearch("clickedObjectIDsAfterSearch", _indexName, new List<string> { "1", "2" },
73+
new List<uint> { 17, 19 }, search1.QueryID);
7474

7575
var search2 = _index.Search<AlgoliaStub>(query);
7676
insights.ConvertedObjectIDsAfterSearch("convertedObjectIDsAfterSearch", _indexName,
77-
new List<string> {"1", "2"}, search2.QueryID);
77+
new List<string> { "1", "2" }, search2.QueryID);
7878
}
7979

8080
public class AlgoliaStub

src/Algolia.Search.Test/Serializer/SerializerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void TestQueryWithNestedList()
108108
Query query2 = new Query("") { FacetFilters = new List<List<string>> { new List<string> { "facet1", "facet2" } } };
109109
Assert.AreEqual(query2.ToQueryString(), "query=&facetFilters=facet1%2Cfacet2");
110110

111-
Query query3 = new Query("") { InsideBoundingBox = new List<List<float>> { new List<float> { 10,35f, 1000,42f } } };
111+
Query query3 = new Query("") { InsideBoundingBox = new List<List<float>> { new List<float> { 10, 35f, 1000, 42f } } };
112112
Assert.AreEqual(query3.ToQueryString(), "query=&insideBoundingBox=10.0%2C35.0%2C1000.0%2C42.0");
113113
}
114114

src/Algolia.Search.Test/TestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ internal static bool AreObjectsEqual(object objectA, object objectB, params stri
141141
}
142142
else if (valueA != null)
143143
{
144-
var collectionItems1 = ((IEnumerable) valueA).Cast<object>();
145-
var collectionItems2 = ((IEnumerable) valueB).Cast<object>();
144+
var collectionItems1 = ((IEnumerable)valueA).Cast<object>();
145+
var collectionItems2 = ((IEnumerable)valueB).Cast<object>();
146146
var collectionItemsCount1 = collectionItems1.Count();
147147
var collectionItemsCount2 = collectionItems2.Count();
148148

src/Algolia.Search/Clients/AccountClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public async Task<MultiResponse> CopyIndexAsync<T>(ISearchIndex sourceIndex, ISe
7575
}
7676
}
7777

78-
MultiResponse ret = new MultiResponse {Responses = new List<IAlgoliaWaitableResponse>()};
78+
MultiResponse ret = new MultiResponse { Responses = new List<IAlgoliaWaitableResponse>() };
7979

8080
// Save settings
8181
IndexSettings sourceSettings = await sourceIndex.GetSettingsAsync(ct: ct).ConfigureAwait(false);

0 commit comments

Comments
 (0)