File tree Expand file tree Collapse file tree 11 files changed +20
-30
lines changed
Chapter-1-initial-architecture/Src
Fitnet.IntegrationTests/Common/Events/EventBus/InMemory Expand file tree Collapse file tree 11 files changed +20
-30
lines changed Original file line number Diff line number Diff line change 1- <Project Sdk =" Microsoft.NET.Sdk" >
2- <Sdk Name =" Aspire.AppHost.Sdk" Version =" 13.0.2" />
1+ <Project Sdk =" Aspire.AppHost.Sdk/13.1.2" >
32
43 <PropertyGroup >
54 <OutputType >Exe</OutputType >
109 </PropertyGroup >
1110
1211 <ItemGroup >
13- <PackageReference Include =" Aspire.Hosting.AppHost" Version =" 13.0.2" />
14- <PackageReference Include =" Aspire.Hosting.PostgreSQL" Version =" 13.0.2" />
12+ <PackageReference Include =" Aspire.Hosting.PostgreSQL" Version =" 13.1.2" />
1513 <PackageReference Update =" SonarAnalyzer.CSharp" Version =" 10.15.0.120848" />
1614 </ItemGroup >
1715
1816 <ItemGroup >
19- <ProjectReference Include =" ..\Fitnet\Fitnet.csproj" />
17+ <ProjectReference Include =" ..\Fitnet\Fitnet.csproj" />
2018 </ItemGroup >
2119
2220</Project >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ internal void BusinessRules_Should_Not_Have_Dependency_On_Module(string forbidde
1818 . HaveNameEndingWith ( forbiddenTypeEnding ) ;
1919
2020 // Act
21- var validationResult = forbiddenTypes ! . Should ( ) . NotHaveDependencyOnAny ( businessRules ) . GetResult ( ) ;
21+ var validationResult = forbiddenTypes . Should ( ) . NotHaveDependencyOnAny ( businessRules ) . GetResult ( ) ;
2222
2323 // Assert
2424 validationResult . FailingTypes . ShouldBeNull ( ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ internal void Contracts_should_not_have_dependency_on_module(string moduleName)
2424 var rules = contractsModule
2525 . Should ( )
2626 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
27- var validationResult = rules ! . GetResult ( ) ;
27+ var validationResult = rules . GetResult ( ) ;
2828
2929 // Assert
3030 validationResult . FailingTypes . ShouldBeNull ( ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ internal void Offers_should_not_have_dependency_on_module(string moduleName)
2525 var rules = offersModule
2626 . Should ( )
2727 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
28- var validationResult = rules ! . GetResult ( ) ;
28+ var validationResult = rules . GetResult ( ) ;
2929
3030 // Assert
3131 validationResult . FailingTypes . ShouldBeNull ( ) ;
@@ -49,7 +49,7 @@ public void OffersShouldCommunicateWithPassesViaEvents()
4949 var rules = offersModule
5050 . Should ( )
5151 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
52- var validationResult = rules ! . GetResult ( ) ;
52+ var validationResult = rules . GetResult ( ) ;
5353
5454 // Assert
5555 validationResult . FailingTypes . ShouldBeNull ( ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ internal void Passes_should_not_have_dependency_on_module(string moduleName)
2525 var rules = passesModule
2626 . Should ( )
2727 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
28- var validationResult = rules ! . GetResult ( ) ;
28+ var validationResult = rules . GetResult ( ) ;
2929
3030 // Assert
3131 validationResult . FailingTypes . ShouldBeNull ( ) ;
@@ -50,7 +50,7 @@ internal void PassesShouldCommunicateWithContractViaEvents()
5050 var rules = passesModule
5151 . Should ( )
5252 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
53- var validationResult = rules ! . GetResult ( ) ;
53+ var validationResult = rules . GetResult ( ) ;
5454
5555 // Assert
5656 validationResult . FailingTypes . ShouldBeNull ( ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ internal void Reports_should_not_have_dependency_on_module(string moduleName)
2424 var rules = reportsModule
2525 . Should ( )
2626 . NotHaveDependencyOnAny ( forbiddenModuleTypes ) ;
27- var validationResult = rules ! . GetResult ( ) ;
27+ var validationResult = rules . GetResult ( ) ;
2828
2929 // Assert
3030 validationResult . FailingTypes . ShouldBeNull ( ) ;
Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ internal async Task Given_valid_event_published_Then_event_should_be_consumed()
1919 var fakeEvent = FakeEvent . Create ( ) ;
2020
2121 // Act
22- await eventBus ! . PublishAsync ( fakeEvent , CancellationToken . None ) ;
22+ await eventBus . PublishAsync ( fakeEvent , CancellationToken . None ) ;
2323
2424 // Assert
2525 fakeEvent . Consumed . ShouldBeTrue ( ) ;
2626 }
2727
2828 private IEventBus GetEventBus ( ) =>
2929 _applicationInMemory . Services
30- . CreateScope ( ) !
30+ . CreateScope ( )
3131 . ServiceProvider
3232 . GetRequiredService < IEventBus > ( ) ;
3333}
Original file line number Diff line number Diff line change 33internal static class ApiDocumentationExtensions
44{
55 internal static void UseApiDocumentation ( this IEndpointRouteBuilder app ) =>
6- app . MapGet ( "/" , ( ) => Results . Redirect ( "/swagger " ) )
6+ app . MapGet ( "/" , ( ) => Results . Redirect ( "/docs/v1 " ) )
77 . WithSummary ( "Documentation for the API" )
88 . WithDescription ( "This endpoint is used to redirect to the documentation for the API." )
99 . Produces ( StatusCodes . Status200OK )
Original file line number Diff line number Diff line change 1414 <PackageReference Include =" Microsoft.EntityFrameworkCore" Version =" 10.0.1" />
1515 <PackageReference Include =" Microsoft.OpenApi" Version =" 2.3.0" />
1616 <PackageReference Include =" Npgsql.EntityFrameworkCore.PostgreSQL" Version =" 10.0.0" />
17- <PackageReference Include =" Swashbuckle .AspNetCore" Version =" 10.0.1 " />
17+ <PackageReference Include =" Scalar .AspNetCore" Version =" 2.12.17 " />
1818 <PackageReference Update =" SonarAnalyzer.CSharp" Version =" 10.15.0.120848" />
1919 </ItemGroup >
2020
Original file line number Diff line number Diff line change 77using EvolutionaryArchitecture . Fitnet . Offers ;
88using EvolutionaryArchitecture . Fitnet . Passes ;
99using EvolutionaryArchitecture . Fitnet . Reports ;
10+ using Scalar . AspNetCore ;
1011
1112var builder = WebApplication . CreateBuilder ( args ) ;
1213
1314builder . Services . AddControllers ( ) ;
1415builder . Services . AddExceptionHandling ( ) ;
15- builder . Services . AddEndpointsApiExplorer ( ) ;
16- builder . Services . AddSwaggerGen ( ) ;
16+ builder . Services . AddOpenApi ( ) ;
1717builder . Services . AddEventBus ( ) ;
1818builder . Services . AddRequestsValidations ( ) ;
1919builder . Services . AddClock ( ) ;
2727
2828if ( app . Environment . IsDevelopment ( ) )
2929{
30- app . UseSwagger ( ) ;
31- app . UseSwaggerUI ( ) ;
30+ app . MapOpenApi ( ) ;
31+ app . MapScalarApiReference ( "/docs/v1" ) ;
3232}
3333
3434app . UseApiDocumentation ( ) ;
You can’t perform that action at this time.
0 commit comments