File tree 5 files changed +35
-27
lines changed
Framework.MessageBroker/RabbitMQ/Explorer
5 files changed +35
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public class RabbitMQExplorer : IRabbitMQExplorer
16
16
public RabbitMQExplorer ( HttpClient client , IConfiguration configuration )
17
17
{
18
18
var uri = configuration . GetConnectionString ( "RabbitMQ" ) ;
19
+
19
20
_rabbitMQURI = new Uri ( uri ) ;
20
21
21
22
_client = client ;
Original file line number Diff line number Diff line change @@ -13,20 +13,24 @@ public BaseTest()
13
13
{
14
14
//Configuration
15
15
var configurationBuilder = new ConfigurationBuilder ( )
16
- . AddEnvironmentVariables ( )
16
+ . SetBasePath ( Directory . GetCurrentDirectory ( ) )
17
+ . AddJsonFile ( "appSettings.json" , optional : false )
17
18
. Build ( ) ;
18
19
19
20
Configuration = configurationBuilder ;
20
21
21
22
var services = new ServiceCollection ( ) ;
23
+
24
+ services . AddSingleton ( Configuration ) ;
25
+
22
26
services . AddSingleton < JsonSerializerCommon > ( ) ;
23
27
services . AddLogging ( opt => opt . AddConsole ( ) ) ;
24
28
25
- ServiceProvider = services . BuildServiceProvider ( ) ;
26
-
27
29
var startup = Activator . CreateInstance < T > ( ) ;
28
30
29
31
startup . ConfigureServices ( services , Configuration ) ;
32
+
33
+ ServiceProvider = services . BuildServiceProvider ( ) ;
30
34
}
31
35
32
36
private IServiceProvider ServiceProvider { get ; }
Original file line number Diff line number Diff line change 4
4
<TargetFramework >netstandard2.0</TargetFramework >
5
5
</PropertyGroup >
6
6
7
- <ItemGroup >
8
- <PackageReference Include =" Bogus" Version =" 27.0.1" />
9
- <PackageReference Include =" Microsoft.Extensions.Configuration.EnvironmentVariables" Version =" 2.2.4" />
10
- <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 2.2.0" />
11
- <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 2.2.0" />
12
- <PackageReference Include =" Microsoft.Extensions.Logging.Console" Version =" 2.2.0" />
13
- <PackageReference Include =" RichardSzalay.MockHttp" Version =" 5.0.0" />
14
- <PackageReference Include =" Shouldly" Version =" 3.0.2" />
15
- </ItemGroup >
7
+ <ItemGroup >
8
+ <PackageReference Include =" Bogus" Version =" 27.0.1" />
9
+ <PackageReference Include =" Microsoft.Extensions.Configuration.EnvironmentVariables" Version =" 2.2.4" />
10
+ <PackageReference Include =" Microsoft.Extensions.Configuration.Json" Version =" 2.2.0" />
11
+ <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 2.2.0" />
12
+ <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 2.2.0" />
13
+ <PackageReference Include =" Microsoft.Extensions.Logging.Console" Version =" 2.2.0" />
14
+ <PackageReference Include =" RichardSzalay.MockHttp" Version =" 5.0.0" />
15
+ <PackageReference Include =" Shouldly" Version =" 3.0.2" />
16
+ </ItemGroup >
16
17
17
- <ItemGroup >
18
- <ProjectReference Include =" ..\Framework.Core\Framework.Core.csproj" />
19
- </ItemGroup >
18
+ <ItemGroup >
19
+ <ProjectReference Include =" ..\Framework.Core\Framework.Core.csproj" />
20
+ </ItemGroup >
21
+
22
+ <ItemGroup >
23
+ <Content Include =" appSettings.json" >
24
+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
25
+ </Content >
26
+ </ItemGroup >
20
27
</Project >
Original file line number Diff line number Diff line change
1
+ {
2
+ "ConnectionStrings" : {
3
+ "RabbitMQ" : " amqp://guest:guest@localhost"
4
+ },
5
+ "RabbitMQSettings" : {
6
+ "QOS" : 5
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments