Skip to content

Commit

Permalink
Prepare for RTM (#481)
Browse files Browse the repository at this point in the history
* Prepare for RTM

* Tweaks

---------

Co-authored-by: Brandon Ording <[email protected]>
  • Loading branch information
andreasohlund and bording authored Mar 6, 2024
1 parent bc97919 commit 2e6bdf7
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 136 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand Down
48 changes: 24 additions & 24 deletions src/AcceptanceTests/AcceptanceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,34 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<Compile Remove="$(NuGetPackageRoot)**\\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(NuGetPackageRoot)**\\ConfigureEndpointMsmqTransport.cs" />
<Compile Remove="$(NuGetPackageRoot)**\\DeterministicGuid.cs" />
<Compile Remove="$(NuGetPackageRoot)**\\Audit\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Correlation\*" />
<Compile Remove="$(NuGetPackageRoot)**\\DataBus\*" />
<Compile Remove="$(NuGetPackageRoot)**\\DelayedDelivery\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Forwarding\*" />
<Compile Remove="$(NuGetPackageRoot)**\\MessageId\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Pipeline\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Recoverability\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Routing\**" />
<Compile Remove="$(NuGetPackageRoot)**\\Satellites\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Scheduling\*" />
<Compile Remove="$(NuGetPackageRoot)**\\SelfVerification\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Serialization\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Sagas\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Outbox\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Timeout\*" />
<Compile Remove="$(NuGetPackageRoot)**\\TimeToBeReceived\*" />
<Compile Remove="$(NuGetPackageRoot)**\\Tx\**" />
<Compile Remove="$(NuGetPackageRoot)**\\Versioning\*" />
<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointMsmqTransport.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\DeterministicGuid.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Audit\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Correlation\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\DataBus\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\DelayedDelivery\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Forwarding\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\MessageId\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Pipeline\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Recoverability\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Routing\**" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Satellites\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Scheduling\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\SelfVerification\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Serialization\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Sagas\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Outbox\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Timeout\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\TimeToBeReceived\*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Tx\**" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void Approve()
{
var publicApi = typeof(TestableUniformSession).Assembly.GeneratePublicApi(new ApiGeneratorOptions
{
ExcludeAttributes = new[] { "System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute" }
ExcludeAttributes = ["System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute"]
});

Approver.Verify(publicApi);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.UniformSession.Testing\NServiceBus.UniformSession.Testing.csproj" />
<ProjectReference Include="..\UniformSession\NServiceBus.UniformSession.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.2" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBus.snk</AssemblyOriginatorKeyFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AssemblyOriginatorKeyFile>..\NServiceBus.snk</AssemblyOriginatorKeyFile>
<Description>NServiceBus Uniform Session Testing</Description>
</PropertyGroup>

Expand All @@ -13,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus.Testing" Version="[9.0.0, 10.0.0)" />
<PackageReference Include="Particular.Packaging" Version="4.1.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
24 changes: 22 additions & 2 deletions src/NServiceBus.UniformSession.Testing/TestableUniformSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,47 @@
using System.Threading.Tasks;
using NServiceBus.Testing;

/// <summary>
/// A testable implementation of <see cref="IUniformSession" />.
/// </summary>
public class TestableUniformSession : IUniformSession
{
TestablePipelineContext innerContext;
TestableMessageSession innerSession;
readonly TestablePipelineContext innerContext;
readonly TestableMessageSession innerSession;

/// <summary>
/// Creates a new instance of <see cref="TestableUniformSession" />.
/// </summary>
public TestableUniformSession() : this(new TestablePipelineContext())
{
}

/// <summary>
/// Creates a new instance of <see cref="TestableUniformSession" />.
/// </summary>
/// <param name="innerSession">The <see cref="TestableMessageSession" /> the session should use to send and publish messages.</param>
public TestableUniformSession(TestableMessageSession innerSession)
{
this.innerSession = innerSession;
}

/// <summary>
/// Creates a new instance of <see cref="TestableUniformSession" />.
/// </summary>
/// <param name="innerContext">The <see cref="TestablePipelineContext" /> the session should use to send and publish messages.</param>
public TestableUniformSession(TestablePipelineContext innerContext)
{
this.innerContext = innerContext;
}

/// <summary>
/// The messages that have been sent from the session.
/// </summary>
public SentMessage<object>[] SentMessages => innerContext?.SentMessages ?? innerSession.SentMessages;

/// <summary>
/// The messages that have been published from the session.
/// </summary>
public PublishedMessage<object>[] PublishedMessages => innerContext?.PublishedMessages ?? innerSession.PublishedMessages;

Task IUniformSession.Send(object message, SendOptions options, CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/APIApprovals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void Approve()
{
var publicApi = typeof(IUniformSession).Assembly.GeneratePublicApi(new ApiGeneratorOptions
{
ExcludeAttributes = new[] { "System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute" }
ExcludeAttributes = ["System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute"]
});
Approver.Verify(publicApi);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.2" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
Expand Down
77 changes: 0 additions & 77 deletions src/UniformSession/Guard.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/UniformSession/NServiceBus.UniformSession.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.2" />
<PackageReference Include="NServiceBus" Version="[9.0.0, 10.0.0)" />
<PackageReference Include="Particular.Packaging" Version="4.1.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
38 changes: 19 additions & 19 deletions src/UniformSession/UniformSessionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public static class UniformSessionExtensions
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send(this IUniformSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

return session.Send(message, new SendOptions(), cancellationToken);
}
Expand All @@ -35,8 +35,8 @@ public static Task Send(this IUniformSession session, object message, Cancellati
/// </remarks>
public static Task Send<T>(this IUniformSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

return session.Send(messageConstructor, new SendOptions(), cancellationToken);
}
Expand All @@ -50,9 +50,9 @@ public static Task Send<T>(this IUniformSession session, Action<T> messageConstr
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send(this IUniformSession session, string destination, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNullAndEmpty(nameof(destination), destination);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentException.ThrowIfNullOrWhiteSpace(destination);
ArgumentNullException.ThrowIfNull(message);

var options = new SendOptions();

Expand All @@ -71,9 +71,9 @@ public static Task Send(this IUniformSession session, string destination, object
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send<T>(this IUniformSession session, string destination, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNullAndEmpty(nameof(destination), destination);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentException.ThrowIfNullOrWhiteSpace(destination);
ArgumentNullException.ThrowIfNull(messageConstructor);

var options = new SendOptions();

Expand All @@ -90,8 +90,8 @@ public static Task Send<T>(this IUniformSession session, string destination, Act
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task SendLocal(this IUniformSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

var options = new SendOptions();

Expand All @@ -109,8 +109,8 @@ public static Task SendLocal(this IUniformSession session, object message, Cance
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task SendLocal<T>(this IUniformSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

var options = new SendOptions();

Expand All @@ -127,8 +127,8 @@ public static Task SendLocal<T>(this IUniformSession session, Action<T> messageC
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Publish(this IUniformSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

return session.Publish(message, new PublishOptions(), cancellationToken);
}
Expand All @@ -141,7 +141,7 @@ public static Task Publish(this IUniformSession session, object message, Cancell
/// <typeparam name="T">The message type.</typeparam>
public static Task Publish<T>(this IUniformSession session, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
ArgumentNullException.ThrowIfNull(session);

return session.Publish<T>(_ => { }, new PublishOptions(), cancellationToken);
}
Expand All @@ -155,8 +155,8 @@ public static Task Publish<T>(this IUniformSession session, CancellationToken ca
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Publish<T>(this IUniformSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

return session.Publish(messageConstructor, new PublishOptions(), cancellationToken);
}
Expand Down

0 comments on commit 2e6bdf7

Please sign in to comment.