Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Nov 13, 2023
1 parent 8dcb9be commit c7e16c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ namespace Backgrounder.Sample
/// </summary>
public static partial class SampleJobMultipleParameterExtensions
{
public record MultipleParameterMessageXEWDF(int? jobId, string? name);

/// <summary>
/// Enqueue the method public Task DoWork(int?, string?) for execution in the background
/// </summary>
public static async global::System.Threading.Tasks.Task MultipleParameter(this global::Backgrounder.IBackgrounder backgrounder, int? jobId, string? name)
{
var parameterTuple = new global::System.Tuple<int?, string?>(jobId, name);
await backgrounder.EnqueueAsync("public Task DoWork(int?, string?)", parameterTuple);
var methodParameters = new MultipleParameterMessageXEWDF(jobId, name);
await backgrounder.EnqueueAsync("public Task DoWork(int?, string?)", methodParameters);
}

internal static async global::System.Threading.Tasks.Task ExecuteMultipleParameterXEWDF(global::System.IServiceProvider serviceProvider, byte[] messageBody)
{
var messageSerializer = serviceProvider.GetRequiredService<global::Backgrounder.IMessageSerializer>();
var methodParameters = messageSerializer.Deserialize<global::System.Tuple<int?, string?>>(messageBody);
var worker = serviceProvider.GetRequiredService<ISampleJob>();
await worker.MultipleParameter(methodParameters.Item1, methodParameters.Item2);
var messageSerializer = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Backgrounder.IMessageSerializer>(serviceProvider);
var methodParameters = messageSerializer.Deserialize<MultipleParameterMessageXEWDF>(messageBody);
var worker = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ISampleJob>(serviceProvider);
await worker.MultipleParameter(methodParameters.jobId, methodParameters.name);
}

[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ namespace Backgrounder.Sample
/// </summary>
public static partial class SampleJobDoWorkExtensions
{
public record DoWorkMessageABCD(int? jobId);

/// <summary>
/// Enqueue the method public Task DoWork(int?) for execution in the background
/// </summary>
public static async global::System.Threading.Tasks.Task DoWork(this global::Backgrounder.IBackgrounder backgrounder, int? jobId)
{
var parameterTuple = new global::System.Tuple<int?>(jobId);
await backgrounder.EnqueueAsync("public Task DoWork(int?)", parameterTuple);
var methodParameters = new DoWorkMessageABCD(jobId);
await backgrounder.EnqueueAsync("public Task DoWork(int?)", methodParameters);
}

internal static async global::System.Threading.Tasks.Task ExecuteDoWorkABCD(global::System.IServiceProvider serviceProvider, byte[] messageBody)
{
var messageSerializer = serviceProvider.GetRequiredService<global::Backgrounder.IMessageSerializer>();
var methodParameters = messageSerializer.Deserialize<global::System.Tuple<int?>>(messageBody);
var worker = serviceProvider.GetRequiredService<SampleJob>();
await worker.DoWork(methodParameters.Item1);
var messageSerializer = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Backgrounder.IMessageSerializer>(serviceProvider);
var methodParameters = messageSerializer.Deserialize<DoWorkMessageABCD>(messageBody);
var worker = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<SampleJob>(serviceProvider);
await worker.DoWork(methodParameters.jobId);
}

[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
Expand Down

0 comments on commit c7e16c2

Please sign in to comment.