Browse Source

Refactor.

master
yangxiaodong 7 years ago
parent
commit
86e5a30169
2 changed files with 7 additions and 7 deletions
  1. +4
    -4
      src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
  2. +3
    -3
      test/DotNetCore.CAP.Test/CAP.BuilderTest.cs

+ 4
- 4
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs View File

@@ -17,13 +17,13 @@ namespace Microsoft.Extensions.DependencyInjection
public static class ServiceCollectionExtensions
{
/// <summary>
/// Adds and configures the consistence services for the consitence.
/// Adds and configures the CAP services for the consitence.
/// </summary>
/// <param name="services">The services available in the application.</param>
/// <returns>An <see cref="CapBuilder"/> for application services.</returns>
public static CapBuilder AddConsistency(this IServiceCollection services)
public static CapBuilder AddCap(this IServiceCollection services)
{
services.AddConsistency(x => new CapOptions());
services.AddCap(x => new CapOptions());

return new CapBuilder(services);
}
@@ -34,7 +34,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="services">The services available in the application.</param>
/// <param name="setupAction">An action to configure the <see cref="CapOptions"/>.</param>
/// <returns>An <see cref="CapBuilder"/> for application services.</returns>
public static CapBuilder AddConsistency(
public static CapBuilder AddCap(
this IServiceCollection services,
Action<CapOptions> setupAction)
{


+ 3
- 3
test/DotNetCore.CAP.Test/CAP.BuilderTest.cs View File

@@ -14,7 +14,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideMessageStore()
{
var services = new ServiceCollection();
services.AddConsistency().AddMessageStore<MyMessageStore>();
services.AddCap().AddMessageStore<MyMessageStore>();

var thingy = services.BuildServiceProvider()

@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideJobs()
{
var services = new ServiceCollection();
services.AddConsistency().AddJobs<MyJobTest>();
services.AddCap().AddJobs<MyJobTest>();

var thingy = services.BuildServiceProvider()
.GetRequiredService<IJob>() as MyJobTest;
@@ -39,7 +39,7 @@ namespace DotNetCore.CAP.Test
public void CanOverrideProducerService()
{
var services = new ServiceCollection();
services.AddConsistency().AddProducerService<MyProducerService>();
services.AddCap().AddProducerService<MyProducerService>();

var thingy = services.BuildServiceProvider()
.GetRequiredService<ICapProducerService>() as MyProducerService;


Loading…
Cancel
Save