diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000..47eb46a --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,25 @@ +# Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [6.1.0] - 2017-06-07 +### Fixed +- The new .NET Standard packaging (in AppVeyor) was creating an incorrect Assembly name. :blush: + +## [6.0.0] - 2017-05-27 +### Changed +- Supports .NET Standard 1.4! Woot! + +### Fixed +- #27: Uri fails to compare/equals when Uri contains characters that get encoded. + +## [5.1.0] - 2017-02-06 +### Added +- Support for `Headers` in `HttpMessageOptions`. + + +## [1.0.0 -> 5.0.0] - 2014-08-07 -> 2017-02-06 +### Added +- Inital and subsequent releases in supporting faking an `HttpClient` request/response. \ No newline at end of file diff --git a/ReleaseNotes.md b/ReleaseNotes.md deleted file mode 100644 index 5ef1eea..0000000 --- a/ReleaseNotes.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release Notes - -### v5.1.0 (2017-02-06) -**Features** -- Added support for `Headers` in `HttpMessageOptions`. - - -### v1.0.0 -> v5.0.0 -- Inital and subsequent releases in supporting faking an `HttpClient` request/response. \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index fa28034..31ff2c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,7 +35,7 @@ build_script: test_script: - dotnet test %tests_project_file% -c %CONFIGURATION% -v normal --no-build - - dotnet pack %library_project_file% /p:Version=%APPVEYOR_BUILD_VERSION% --no-build + - dotnet pack %library_project_file% -c %CONFIGURATION% /p:Version=%APPVEYOR_BUILD_VERSION% --no-build artifacts: - path: '**\*.nupkg' diff --git a/src/HttpClient.Helpers/FakeMessageHandler.cs b/src/HttpClient.Helpers/FakeMessageHandler.cs index 94d546f..25f5c9d 100644 --- a/src/HttpClient.Helpers/FakeMessageHandler.cs +++ b/src/HttpClient.Helpers/FakeMessageHandler.cs @@ -39,12 +39,7 @@ public FakeHttpMessageHandler(IEnumerable lotsOfOptions) /// The exception that will occur. public FakeHttpMessageHandler(HttpRequestException exception) { - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - _exception = exception; + _exception = exception ?? throw new ArgumentNullException(nameof(exception)); } protected override Task SendAsync(HttpRequestMessage request, diff --git a/src/HttpClient.Helpers/HttpClient.Helpers.csproj b/src/HttpClient.Helpers/HttpClient.Helpers.csproj index 2f7b729..5d86638 100644 --- a/src/HttpClient.Helpers/HttpClient.Helpers.csproj +++ b/src/HttpClient.Helpers/HttpClient.Helpers.csproj @@ -15,6 +15,8 @@ http://i.imgur.com/bR4Yf.jpg https://github.com/PureKrome/HttpClient.Helpers httpclient worlddomination worldomination unicorn magicalunicorn magical-unicorn + WorldDomination.Net.Http + WorldDomination.HttpClient.Helpers diff --git a/src/HttpClient.Helpers/HttpClient.Helpers.nuspec b/src/HttpClient.Helpers/HttpClient.Helpers.nuspec deleted file mode 100644 index ed76790..0000000 --- a/src/HttpClient.Helpers/HttpClient.Helpers.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - WorldDomination.HttpClient.Helpers - $version$ - HttpClient helpers for System.Net.Http.HttpClient - Justin Adler - Justin Adler - https://raw.githubusercontent.com/PureKrome/HttpClient.Helpers/master/LICENSE - https://github.com/PureKrome/HttpClient.Helpers - http://i.imgur.com/bR4Yf.jpg - false - Some simple System.Net.Http.HttpClient helpers to help with your unit tests or when you don't really want to call the endpoint. - Some simple System.Net.Http.HttpClient helpers. - 2014 - en-AU - httpclient worlddomination worldomination unicorn magicalunicorn magical-unicorn - - - - Added support for Headers in HttpMessageOptions. - - - - - \ No newline at end of file diff --git a/src/HttpClient.Helpers/HttpMessageOptions.cs b/src/HttpClient.Helpers/HttpMessageOptions.cs index a4a2467..763ab02 100644 --- a/src/HttpClient.Helpers/HttpMessageOptions.cs +++ b/src/HttpClient.Helpers/HttpMessageOptions.cs @@ -8,7 +8,7 @@ namespace WorldDomination.Net.Http { public class HttpMessageOptions { - private const string _anyValue = "*"; + private const string AnyValue = "*"; private HttpContent _httpContent; private string _httpContentSerialized; @@ -32,7 +32,7 @@ public class HttpMessageOptions /// public HttpContent HttpContent { - get { return _httpContent; } + get => _httpContent; set { _httpContent = value; @@ -50,11 +50,12 @@ public HttpContent HttpContent // Note: I'm using reflection to set the value in here because I want this value to be _read-only_. // Secondly, this occurs during a UNIT TEST, so I consider the expensive reflection costs to be // acceptable in this situation. + // ReSharper disable once UnusedAutoPropertyAccessor.Local public int NumberOfTimesCalled { get; private set; } public override string ToString() { - var httpMethodText = HttpMethod?.ToString() ?? _anyValue; + var httpMethodText = HttpMethod?.ToString() ?? AnyValue; var headers = Headers != null && Headers.Any()