Skip to content

Commit

Permalink
Merge pull request #18 from myarichuk/develop
Browse files Browse the repository at this point in the history
Replace helper with BCL HashCode::Combine() function
  • Loading branch information
myarichuk authored May 3, 2020
2 parents 51adadb + a12e3b4 commit e9d7b83
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 318 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ before_install:
install:
- dotnet restore
script:
- dotnet build
- dotnet test
- bash ./tools/travis-ci-build.sh
307 changes: 0 additions & 307 deletions Simple.HttpClientFactory/HashHelper.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Easy.Common;
using System;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
Expand Down Expand Up @@ -51,7 +50,7 @@ private struct UriCacheKey : IEquatable<UriCacheKey>

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

public override int GetHashCode() => HashHelper.GetHashCode(_uri.Scheme, _uri.DnsSafeHost, _uri.Port);
public override int GetHashCode() => HashCode.Combine(_uri.Scheme, _uri.DnsSafeHost, _uri.Port);

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

Expand Down
13 changes: 10 additions & 3 deletions Simple.HttpClientFactory/Simple.HttpClientFactory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@
<ProjectGuid>{709E1EB5-F770-4569-B08A-7867035217F3}</ProjectGuid>
</PropertyGroup>

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

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

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)|$(Platform)'=='netstandard2.0|AnyCPU'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
<PackageReference Include="Polly" Version="7.2.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Net.Security" Version="4.3.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)|$(Platform)'=='netcoreapp2.1|AnyCPU'">
<PackageReference Include="Polly" Version="7.2.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Net.Security" Version="4.3.2" />
Expand Down
4 changes: 1 addition & 3 deletions tools/travis-ci-build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/sh
echo "Changing to /src directory..."
cd src
echo "Executing MSBuild DLL begin command..."
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}
echo "Running build..."
dotnet build
echo "Running tests..."
dotnet test --logger:trx
dotnet test --logger:trx --collect "DotnetCodeCoverage"
echo "Executing MSBuild DLL end command..."
dotnet tools/sonar/SonarScanner.MSBuild.dll end /d:sonar.login=${SONAR_TOKEN}

0 comments on commit e9d7b83

Please sign in to comment.