-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
1 parent
63a8b3c
commit 4a0d181
Showing
10 changed files
with
109 additions
and
106 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
2 changes: 1 addition & 1 deletion
2
...unchclockTests.netcoreapp3.1.approved.txt → ...ts.PunchclockTests.DotNet6_0.verified.txt
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
3 changes: 1 addition & 2 deletions
3
...Tests.PunchclockTests.net472.approved.txt → ...ts.PunchclockTests.DotNet7_0.verified.txt
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
3 changes: 1 addition & 2 deletions
3
...Tests.PunchclockTests.net6.0.approved.txt → ...ts.PunchclockTests.DotNet8_0.verified.txt
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
25 changes: 25 additions & 0 deletions
25
src/Punchclock.Tests/API/ApiApprovalTests.PunchclockTests.Net4_7.verified.txt
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,25 @@ | ||
[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName=".NET Standard 2.0")] | ||
namespace Punchclock | ||
{ | ||
public class OperationQueue : System.IDisposable | ||
{ | ||
public OperationQueue(int maximumConcurrent = 4) { } | ||
public void Dispose() { } | ||
protected virtual void Dispose(bool isDisposing) { } | ||
public System.IObservable<T> EnqueueObservableOperation<T>(int priority, System.Func<System.IObservable<T>> asyncCalculationFunc) { } | ||
public System.IObservable<T> EnqueueObservableOperation<T>(int priority, string key, System.Func<System.IObservable<T>> asyncCalculationFunc) { } | ||
public System.IObservable<T> EnqueueObservableOperation<T, TDontCare>(int priority, string key, System.IObservable<TDontCare> cancel, System.Func<System.IObservable<T>> asyncCalculationFunc) { } | ||
public System.IDisposable PauseQueue() { } | ||
public void SetMaximumConcurrent(int maximumConcurrent) { } | ||
public System.IObservable<System.Reactive.Unit> ShutdownQueue() { } | ||
} | ||
public static class OperationQueueExtensions | ||
{ | ||
public static System.Threading.Tasks.Task Enqueue(this Punchclock.OperationQueue operationQueue, int priority, System.Func<System.Threading.Tasks.Task> asyncOperation) { } | ||
public static System.Threading.Tasks.Task Enqueue(this Punchclock.OperationQueue operationQueue, int priority, string key, System.Func<System.Threading.Tasks.Task> asyncOperation) { } | ||
public static System.Threading.Tasks.Task Enqueue(this Punchclock.OperationQueue operationQueue, int priority, string key, System.Func<System.Threading.Tasks.Task> asyncOperation, System.Threading.CancellationToken token) { } | ||
public static System.Threading.Tasks.Task<T> Enqueue<T>(this Punchclock.OperationQueue operationQueue, int priority, System.Func<System.Threading.Tasks.Task<T>> asyncOperation) { } | ||
public static System.Threading.Tasks.Task<T> Enqueue<T>(this Punchclock.OperationQueue operationQueue, int priority, string key, System.Func<System.Threading.Tasks.Task<T>> asyncOperation) { } | ||
public static System.Threading.Tasks.Task<T> Enqueue<T>(this Punchclock.OperationQueue operationQueue, int priority, string key, System.Func<System.Threading.Tasks.Task<T>> asyncOperation, System.Threading.CancellationToken token) { } | ||
} | ||
} |
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,42 @@ | ||
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
using PublicApiGenerator; | ||
using VerifyXunit; | ||
|
||
namespace Punchclock.APITests; | ||
|
||
/// <summary> | ||
/// A helper for doing API approvals. | ||
/// </summary> | ||
public static class ApiExtensions | ||
{ | ||
/// <summary> | ||
/// Checks to make sure the API is approved. | ||
/// </summary> | ||
/// <param name="assembly">The assembly that is being checked.</param> | ||
/// <param name="namespaces">The namespaces.</param> | ||
/// <param name="filePath">The caller file path.</param> | ||
/// <returns> | ||
/// A Task. | ||
/// </returns> | ||
public static async Task CheckApproval(this Assembly assembly, string[] namespaces, [CallerFilePath] string filePath = "") | ||
{ | ||
var generatorOptions = new ApiGeneratorOptions { AllowNamespacePrefixes = namespaces }; | ||
var apiText = assembly.GeneratePublicApi(generatorOptions); | ||
var result = await Verifier.Verify(apiText, null, filePath) | ||
.UniqueForRuntimeAndVersion() | ||
.ScrubEmptyLines() | ||
.ScrubLines(l => | ||
l.StartsWith("[assembly: AssemblyVersion(", StringComparison.InvariantCulture) || | ||
l.StartsWith("[assembly: AssemblyFileVersion(", StringComparison.InvariantCulture) || | ||
l.StartsWith("[assembly: AssemblyInformationalVersion(", StringComparison.InvariantCulture) || | ||
l.StartsWith("[assembly: System.Reflection.AssemblyMetadata(", StringComparison.InvariantCulture)); | ||
} | ||
} |
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,16 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0</TargetFrameworks> | ||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks> | ||
<NoWarn>$(NoWarn);1591;CA1707;SA1633</NoWarn> | ||
</PropertyGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> | ||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net472</TargetFrameworks> | ||
<NoWarn>$(NoWarn);1591;CA1707;SA1633</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="DynamicData" Version="8.*" /> | ||
<PackageReference Include="splat" Version="14.*" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="DynamicData" Version="8.*" /> | ||
<PackageReference Include="splat" Version="14.*" /> | ||
<PackageReference Include="PublicApiGenerator" Version="11.0.0" /> | ||
<PackageReference Include="Verify.Xunit" Version="22.5.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Punchclock\Punchclock.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Punchclock\Punchclock.csproj" /> | ||
</ItemGroup> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"version": "7.0.400", | ||
"version": "8.0.10", | ||
"rollForward": "latestMinor" | ||
}, | ||
"msbuild-sdks": { | ||
|