Skip to content

Commit 3a4032f

Browse files
committed
chore: csharp command
1 parent 9e2ede8 commit 3a4032f

File tree

4 files changed

+40
-48
lines changed

4 files changed

+40
-48
lines changed

scripts/formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export async function formatter(language: string, cwd: string): Promise<void> {
66
switch (language) {
77
case 'csharp':
88
if (cwd.includes('tests') || cwd.includes('snippets') || cwd.includes('guides')) {
9-
await run('dotnet format --no-restore && dotnet tool restore && dotnet csharpier .', {
9+
await run('dotnet format --no-restore && dotnet tool restore && dotnet csharpier format .', {
1010
cwd,
1111
language,
1212
});
Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>disable</Nullable>
7-
8-
<IsPackable>false</IsPackable>
9-
<IsTestProject>true</IsTestProject>
10-
<LangVersion>12</LangVersion>
11-
</PropertyGroup>
12-
13-
<ItemGroup>
14-
<ProjectReference
15-
Include="..\..\..\..\clients/algoliasearch-client-csharp\algoliasearch\Algolia.Search.csproj" />
16-
</ItemGroup>
17-
18-
<ItemGroup>
19-
<PackageReference Include="dotenv.net" Version="3.2.1" />
20-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
21-
<PackageReference Include="Moq" Version="4.20.72" />
22-
<PackageReference Include="Quibble.Xunit" Version="0.3.1" />
23-
<PackageReference Include="System.Text.Json" Version="9.0.4" />
24-
<PackageReference Include="xunit" Version="2.9.3" />
25-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
26-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27-
<PrivateAssets>all</PrivateAssets>
28-
</PackageReference>
29-
<PackageReference Include="coverlet.collector" Version="6.0.4">
30-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31-
<PrivateAssets>all</PrivateAssets>
32-
</PackageReference>
33-
</ItemGroup>
34-
35-
<ItemGroup>
36-
<None Update=".env">
37-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
38-
</None>
39-
</ItemGroup>
40-
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>disable</Nullable>
6+
<IsPackable>false</IsPackable>
7+
<IsTestProject>true</IsTestProject>
8+
<LangVersion>12</LangVersion>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\..\..\clients/algoliasearch-client-csharp\algoliasearch\Algolia.Search.csproj" />
12+
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="dotenv.net" Version="3.2.1" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
16+
<PackageReference Include="Moq" Version="4.20.72" />
17+
<PackageReference Include="Quibble.Xunit" Version="0.3.1" />
18+
<PackageReference Include="System.Text.Json" Version="9.0.4" />
19+
<PackageReference Include="xunit" Version="2.9.3" />
20+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
<PrivateAssets>all</PrivateAssets>
23+
</PackageReference>
24+
<PackageReference Include="coverlet.collector" Version="6.0.4">
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
<PrivateAssets>all</PrivateAssets>
27+
</PackageReference>
28+
</ItemGroup>
29+
<ItemGroup>
30+
<None Update=".env">
31+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32+
</None>
33+
</ItemGroup>
4134
</Project>

tests/output/csharp/src/CompressionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ await client.CustomPostAsync(
3737
GZipStream gZipStream = new(lastResponseBodyStream, CompressionMode.Decompress);
3838
var reader = new StreamReader(gZipStream);
3939

40-
var exception = await Assert.ThrowsAsync<InvalidDataException>(
41-
async () => await reader.ReadToEndAsync()
40+
var exception = await Assert.ThrowsAsync<InvalidDataException>(async () =>
41+
await reader.ReadToEndAsync()
4242
);
4343

4444
Assert.Equal(

tests/output/csharp/src/RetryStrategyTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ public async Task ShouldRetryOnAllEligibleHostFailed()
4343
);
4444

4545
// Do a simple search
46-
await Assert.ThrowsAsync<AlgoliaUnreachableHostException>(
47-
async () =>
48-
await client.SearchSingleIndexAsync<object>(
49-
"test-index",
50-
new SearchParams(new SearchParamsObject { Query = "" })
51-
)
46+
await Assert.ThrowsAsync<AlgoliaUnreachableHostException>(async () =>
47+
await client.SearchSingleIndexAsync<object>(
48+
"test-index",
49+
new SearchParams(new SearchParamsObject { Query = "" })
50+
)
5251
);
5352

5453
Assert.Equal(eligibleHosts, actualHosts);

0 commit comments

Comments
 (0)