diff --git a/Directory.Build.props b/Directory.Build.props index 4fe4486..b7c2d83 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,25 +1,19 @@ - net6.0;net7.0;net8.0; - 6.* - 7.* + net8.0;net10.0 8.* + 10.* - 2.2.3 - 2.2.3 - 3.6.2 + 4.2.3 + 4.2.3 - 16.9.4 - 16.9.4 - 17.12.0 + 18.5.1 + 18.5.1 - 3.0.2 - 3.0.2 - 3.1.2 + 10.0.1 + 10.0.1 1.2.0-preview.* - 1.9.0 - 1.9.0 11.1.0 6.0.0 7.17.4 diff --git a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj index bdce84b..f813355 100644 --- a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj +++ b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj @@ -7,15 +7,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs index 558d571..2ab019e 100644 --- a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs +++ b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs @@ -54,7 +54,7 @@ public OpenTelemetryInstrumentationOptions(IServiceProvider serviceProvider) /// public Action EntityFrameworkInstrumentationOptions { get; set; } = options => { - options.SetDbStatementForText = true; + //options.en = true; }; public Action ElasticsearchClientInstrumentationOptions { get; set; } = options => diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Alert.Tests/AlertClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Alert.Tests/AlertClientTest.cs index 22b10db..8d9c3d8 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Alert.Tests/AlertClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Alert.Tests/AlertClientTest.cs @@ -20,13 +20,13 @@ public void TestAddAlertClient() public void TestAddAlertClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAlertClient(alertServiceBaseAddress: null!)); + Assert.Throws(() => services.AddAlertClient(alertServiceBaseAddress: null!)); } [TestMethod] public void TestAddAlertClientShouldThrowArgumentNullException2() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAlertClient(callerBuilder: null!)); + Assert.Throws(() => services.AddAlertClient(callerBuilder: null!)); } } diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs index 80febaa..20ea0f4 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs @@ -21,7 +21,7 @@ public void TestAddAuthClient() public void TestAddAuthClientNoAddMasaIdentity() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAuthClient("https://localhost:18102", new()), + Assert.Throws(() => services.AddAuthClient("https://localhost:18102", new()), "Please add IMultiEnvironmentUserContext first."); } @@ -29,7 +29,7 @@ public void TestAddAuthClientNoAddMasaIdentity() public void TestAddAuthClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAuthClient(authServiceBaseAddress: null!, new())); + Assert.Throws(() => services.AddAuthClient(authServiceBaseAddress: null!, new())); } } diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs index 40100b2..024deb3 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs @@ -20,13 +20,13 @@ public void TestAddMcClient() public void TestAddMcClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddMcClient(mcServiceBaseAddress: null!)); + Assert.Throws(() => services.AddMcClient(mcServiceBaseAddress: null!)); } [TestMethod] public void TestAddMcClientShouldThrowArgumentNullException2() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddMcClient(callerBuilder: null!)); + Assert.Throws(() => services.AddMcClient(callerBuilder: null!)); } } diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/EventMiddlewareTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/EventMiddlewareTest.cs index 0477fa0..ec770d5 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/EventMiddlewareTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/EventMiddlewareTest.cs @@ -67,10 +67,10 @@ public EventMiddlewareTest() } [TestMethod] - public void TestCommand() + public async Task TestCommand() { var command = new TestCommand(); - Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(command), "DISABLED_OPERATE"); + await Assert.ThrowsAsync(async () => await _eventBus.PublishAsync(command), "DISABLED_OPERATE"); } [TestMethod] diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/RequestMiddlewareTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/RequestMiddlewareTest.cs index 0a142d5..5ffd070 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/RequestMiddlewareTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Middleware.Tests/RequestMiddlewareTest.cs @@ -68,15 +68,15 @@ await requestMiddleware.InvokeAsync(defaultContext, (innerHttpContext) => } [TestMethod] - public void TestDisabledRequestMiddleware() + public async Task TestDisabledRequestMiddleware() { DefaultHttpContext defaultContext = new DefaultHttpContext(); defaultContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new DisabledRouteAttribute()), "myapp")); var requestMiddleware = _serviceProvider.GetRequiredService(); - Assert.ThrowsExceptionAsync(async () => - await requestMiddleware.InvokeAsync(defaultContext, (innerHttpContext) => + await Assert.ThrowsAsync(async () => + await requestMiddleware.InvokeAsync(defaultContext, (innerHttpContext) => { return Task.CompletedTask; })); diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs index 5fde11d..af8149d 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs @@ -39,7 +39,7 @@ public void TestAddPmClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddPmClient("")); + Assert.Throws(() => services.AddPmClient("")); } [TestMethod] diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Sapp.Tests/SappClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Sapp.Tests/SappClientTest.cs index 3792493..8a5809d 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Sapp.Tests/SappClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Sapp.Tests/SappClientTest.cs @@ -39,7 +39,7 @@ public void TestAddSappClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddSappClient("")); + Assert.Throws(() => services.AddSappClient("")); } [TestMethod] diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs index 3d84ad6..6109bee 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs @@ -37,7 +37,7 @@ public void TestAddSchedulerClientShouldThrowArgumentNullException() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddSchedulerClient("")); + Assert.Throws(() => services.AddSchedulerClient("")); } [TestMethod] @@ -45,7 +45,7 @@ public void TestAddSchedulerClientShouldThrowArgumentNullException2() { var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddSchedulerClient(callerBuilder: null!)); + Assert.Throws(() => services.AddSchedulerClient(callerBuilder: null!)); } } diff --git a/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs index 8774d85..1d2c055 100644 --- a/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs +++ b/src/Contrib/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs @@ -152,7 +152,7 @@ public async Task TestAddSchedulerJobArgumentNullException() var caller = new Mock(); caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); var schedulerClient = new SchedulerClient(caller.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + await Assert.ThrowsAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); } [TestMethod] @@ -170,7 +170,7 @@ public async Task TestAddSchedulerHttpJobArgumentNullException() var caller = new Mock(); caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); var schedulerClient = new SchedulerClient(caller.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + await Assert.ThrowsAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); } [TestMethod] @@ -188,7 +188,7 @@ public async Task TestAddSchedulerJobAppArgumentNullException() var caller = new Mock(); caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); var schedulerClient = new SchedulerClient(caller.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + await Assert.ThrowsAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); } [TestMethod] @@ -206,7 +206,7 @@ public async Task TestAddSchedulerDaprInvocationJobArgumentNullException() var caller = new Mock(); caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); var schedulerClient = new SchedulerClient(caller.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + await Assert.ThrowsAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); } [TestMethod]