Skip to content

Commit e9d7b83

Browse files
authored
Merge pull request #18 from myarichuk/develop
Replace helper with BCL HashCode::Combine() function
2 parents 51adadb + a12e3b4 commit e9d7b83

5 files changed

Lines changed: 13 additions & 318 deletions

File tree

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ before_install:
88
install:
99
- dotnet restore
1010
script:
11-
- dotnet build
12-
- dotnet test
1311
- bash ./tools/travis-ci-build.sh

Simple.HttpClientFactory/HashHelper.cs

Lines changed: 0 additions & 307 deletions
This file was deleted.

Simple.HttpClientFactory/MessageHandlers/HttpClientHandlerEx.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Easy.Common;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Net;
54
using System.Net.Http;
@@ -51,7 +50,7 @@ private struct UriCacheKey : IEquatable<UriCacheKey>
5150

5251
public override bool Equals(object obj) => obj is UriCacheKey other && Equals(other);
5352

54-
public override int GetHashCode() => HashHelper.GetHashCode(_uri.Scheme, _uri.DnsSafeHost, _uri.Port);
53+
public override int GetHashCode() => HashCode.Combine(_uri.Scheme, _uri.DnsSafeHost, _uri.Port);
5554

5655
public static bool operator ==(UriCacheKey left, UriCacheKey right) => left.Equals(right);
5756

Simple.HttpClientFactory/Simple.HttpClientFactory.csproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@
1313
<ProjectGuid>{709E1EB5-F770-4569-B08A-7867035217F3}</ProjectGuid>
1414
</PropertyGroup>
1515

16-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
16+
<PropertyGroup Condition="'$(TargetFramework)|$(Platform)'=='netstandard2.0|AnyCPU'">
1717
<CodeAnalysisRuleSet>Simple.HttpClientFactory.ruleset</CodeAnalysisRuleSet>
1818
</PropertyGroup>
1919

20-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
20+
<PropertyGroup Condition="'$(TargetFramework)|$(Platform)'=='netcoreapp2.1|AnyCPU'">
2121
<CodeAnalysisRuleSet>Simple.HttpClientFactory.ruleset</CodeAnalysisRuleSet>
2222
</PropertyGroup>
2323

24-
<ItemGroup>
24+
<ItemGroup Condition="'$(TargetFramework)|$(Platform)'=='netstandard2.0|AnyCPU'">
25+
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
26+
<PackageReference Include="Polly" Version="7.2.0" />
27+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
28+
<PackageReference Include="System.Net.Security" Version="4.3.2" />
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'$(TargetFramework)|$(Platform)'=='netcoreapp2.1|AnyCPU'">
2532
<PackageReference Include="Polly" Version="7.2.0" />
2633
<PackageReference Include="System.Net.Http" Version="4.3.4" />
2734
<PackageReference Include="System.Net.Security" Version="4.3.2" />

tools/travis-ci-build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/sh
2-
echo "Changing to /src directory..."
3-
cd src
42
echo "Executing MSBuild DLL begin command..."
53
dotnet tools/sonar/SonarScanner.MSBuild.dll begin /o:"myarichuk" /k:"myarichuk_Simple.HttpClientFactory" /d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.verbose=true /d:sonar.login=${SONAR_TOKEN}
64
echo "Running build..."
75
dotnet build
86
echo "Running tests..."
9-
dotnet test --logger:trx
7+
dotnet test --logger:trx --collect "DotnetCodeCoverage"
108
echo "Executing MSBuild DLL end command..."
119
dotnet tools/sonar/SonarScanner.MSBuild.dll end /d:sonar.login=${SONAR_TOKEN}

0 commit comments

Comments
 (0)