Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5718ec0
Added NTLM authentication and small updates
mihaj Nov 19, 2020
e54faf7
Merge branch 'main' into develop
mihaj Dec 7, 2020
8e60581
Upload files with multipart content type
mihaj Dec 7, 2020
8db309a
Merge branch 'develop' of https://github.com/qatoolkit/qatoolkit-engi…
mihaj Dec 7, 2020
280b19a
Merge branch 'main' into develop
mihaj Dec 7, 2020
f0f9f5e
CreateHttpRequest override that accepts HttpRequest object
mihaj Dec 12, 2020
48787a2
Merge branch 'main' into develop
mihaj Dec 12, 2020
df94c4e
Merge branch 'develop' of https://github.com/qatoolkit/qatoolkit-engi…
mihaj Dec 12, 2020
2557cc8
Merge branch 'main' into develop
mihaj Dec 12, 2020
f05c3cd
Asserter has new methods ResponseStatusCodeIsSuccess and ResponseBody…
mihaj Dec 14, 2020
9dc1f90
Merge branch 'main' into develop
mihaj Dec 14, 2020
4f55262
HttpTester client now has WithPathReplacementValues, bug fix with que…
mihaj Dec 14, 2020
3a58192
Merge branch 'main' into develop
mihaj Dec 14, 2020
b3ba223
maintenance
mihaj Dec 30, 2020
3d5b02f
year update
mihaj Jan 2, 2021
9989309
Http duration added, XML deserializer for HTTP response content
mihaj Feb 22, 2021
4deb763
Merge branch 'main' into develop
mihaj Feb 22, 2021
c99d168
HTTP authentication with client certificate
mihaj Apr 13, 2021
c6e3ba2
Merge branch 'main' into develop
mihaj Apr 13, 2021
2bc133a
nuget updates
mihaj Aug 17, 2021
6b7ea84
Merge branch 'main' into develop
mihaj Aug 17, 2021
4787e81
nuget updates
mihaj Aug 17, 2021
5795435
Implementation of assert named ResponseContentTypeEquals (#32)
mihaj Nov 1, 2021
1c95e75
Merge branch 'main' into develop
mihaj Nov 1, 2021
d785995
asserter updates (#34)
mihaj Nov 3, 2021
8304834
Merge branch 'main' into develop
mihaj Nov 3, 2021
df7891e
removed duplicate function
mihaj Nov 3, 2021
1f94a3d
add or update HTTP headers
mihaj Dec 18, 2021
c7ba579
Merge branch 'main' into develop
mihaj Dec 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Install dependencies
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/sonarqube-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: SonarScanner for .NET Core with pull request decoration support
uses: highbyte/sonarscan-dotnet@2.0
uses: highbyte/sonarscan-dotnet@v2.1.2
with:
sonarProjectKey: qatoolkit_qatoolkit-engine-httptester-net
sonarProjectName: qatoolkit_qatoolkit-engine-httptester-net
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>0.3.4</Version>
<Version>0.3.5</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ using (var client = new HttpTesterClient())

MIT License

Copyright (c) 2020-2021 Miha Jakovac
Copyright (c) 2020-2022 Miha Jakovac

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
371 changes: 207 additions & 164 deletions src/QAToolKit.Engine.HttpTester.Test/HttpTesterClientTests.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -12,11 +12,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="ExpectedObjects" Version="3.5.3" />
<PackageReference Include="QAToolKit.Source.Swagger" Version="0.3.9" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="ExpectedObjects" Version="3.5.4" />
<PackageReference Include="QAToolKit.Source.Swagger" Version="0.3.9" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
32 changes: 30 additions & 2 deletions src/QAToolKit.Engine.HttpTester/HttpTesterClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,26 @@ public IHttpTesterClient WithPathReplacementValues(Dictionary<string, string> pa
/// <returns></returns>
public IHttpTesterClient WithHeaders(Dictionary<string, string> headers)
{
_headers = headers ?? throw new ArgumentException($"{nameof(headers)} is null.");

if (headers == null)
{
throw new ArgumentException($"{nameof(headers)} is null.");
}

if (_headers == null || _headers.Count == 0)
{
_headers = headers;
}
else
{
foreach (var header in headers)
{
if (!_headers.ContainsKey(header.Key))
{
_headers.Add(header.Key, header.Value);
}
}
}

return this;
}

Expand Down Expand Up @@ -427,6 +445,16 @@ public async Task<HttpResponseMessage> Start()
return _responseMessage;
}

public Dictionary<string, string> GetRequestHeaders()
{
return _headers;
}

public Dictionary<string, string> GetQueryParameters()
{
return _queryParameters;
}

/// <summary>
/// Dispose the object
/// </summary>
Expand Down