-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
515 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 25 additions & 26 deletions
51
src/AzurePipelines.TestLogger/AzurePipelines.TestLogger.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard1.5</TargetFramework> | ||
<Version>1.0.0</Version> | ||
<AssemblyVersion>1.0.0.0</AssemblyVersion> | ||
<FileVersion>1.0.0.0</FileVersion> | ||
</PropertyGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard1.5</TargetFramework> | ||
<Version>1.0.0</Version> | ||
<AssemblyVersion>1.0.0.0</AssemblyVersion> | ||
<FileVersion>1.0.0.0</FileVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="contentFiles\**" /> | ||
<EmbeddedResource Remove="contentFiles\**" /> | ||
<None Remove="contentFiles\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.0.0" /> | ||
<PackageReference Include="Semver" Version="2.0.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
<_Parameter1>AzurePipelines.TestLogger.Tests</_Parameter1> | ||
</AssemblyAttribute> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
</Project> | ||
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.0.0" /> | ||
<PackageReference Include="Semver" Version="2.0.6" GeneratePathProperty="true" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
<_Parameter1>AzurePipelines.TestLogger.Tests</_Parameter1> | ||
</AssemblyAttribute> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
<Target Name="CopyFileFromNuGetPackage" AfterTargets="Build"> | ||
<Copy SourceFiles="$(PkgSemver)\lib\netstandard1.1\Semver.dll" DestinationFolder="$(OutDir)" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/AzurePipelines.TestLogger.Tests/CaptureRequestsMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace AzurePipelines.TestLogger.Tests | ||
{ | ||
public class CaptureRequestsMiddleware | ||
{ | ||
private readonly RequestDelegate _next; | ||
|
||
public CaptureRequestsMiddleware(RequestDelegate next) | ||
{ | ||
_next = next; | ||
} | ||
|
||
public async Task Invoke(HttpContext context) | ||
{ | ||
// Capture the incoming request and store it | ||
IRequestStore requestStore = context.RequestServices.GetService<IRequestStore>(); | ||
requestStore.Add(context.Request); | ||
|
||
// Call the next middleware in the pipeline | ||
await _next(context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Microsoft.AspNetCore.Http; | ||
|
||
namespace AzurePipelines.TestLogger.Tests | ||
{ | ||
internal interface IRequestStore | ||
{ | ||
void Add(HttpRequest item); | ||
} | ||
} |
Oops, something went wrong.