File tree Expand file tree Collapse file tree 12 files changed +24
-24
lines changed
Expand file tree Collapse file tree 12 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 88 </PropertyGroup >
99
1010 <ItemGroup >
11- <PackageReference Include =" Pure.DI" Version =" 2.1.35 " >
11+ <PackageReference Include =" Pure.DI" Version =" 2.1.36 " >
1212 <PrivateAssets >all</PrivateAssets >
1313 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
1414 </PackageReference >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ namespace App;
55internal partial class Composition
66{
77 private static void Setup ( ) => DI . Setup ( )
8- // Based on the Composition setup from the Lib namespace
9- . DependsOn ( "Lib.Composition" )
10- . Root < Program > ( nameof ( Root ) ) ;
8+ // Based on the Composition setup from the Lib namespace
9+ . DependsOn ( "Lib.Composition" )
10+ . Root < Program > ( nameof ( Root ) ) ;
1111}
Original file line number Diff line number Diff line change @@ -7,25 +7,25 @@ public partial class MyServiceTests
77{
88 private readonly Mock < IOutput > _output = new ( ) ;
99 private readonly Mock < IInput > _input = new ( ) ;
10-
10+
1111 [ Fact ]
1212 public void ShouldAskToPressEnter ( )
1313 {
1414 // Given
15-
15+
1616 // When
1717 Service . Run ( ) ;
1818
1919 // Then
2020 _output . Verify ( i => i . WriteLine ( "Hello!" ) ) ;
2121 _output . Verify ( i => i . WriteLine ( "Press the Enter key to exit." ) ) ;
2222 }
23-
23+
2424 [ Fact ]
2525 public void ShouldWaitForEnter ( )
2626 {
2727 // Given
28-
28+
2929 // When
3030 Service . Run ( ) ;
3131
Original file line number Diff line number Diff line change 1818 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
1919 </PackageReference >
2020 <PackageReference Include =" Moq" Version =" 4.20.71" />
21- <PackageReference Include =" Pure.DI" Version =" 2.1.35 " >
21+ <PackageReference Include =" Pure.DI" Version =" 2.1.36 " >
2222 <PrivateAssets >all</PrivateAssets >
2323 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
2424 </PackageReference >
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ public class MyServiceTests
66{
77 private readonly Mock < IOutput > _output = new ( ) ;
88 private readonly Mock < IInput > _input = new ( ) ;
9-
9+
1010 [ Fact ]
1111 public void ShouldAskToPressEnter ( )
1212 {
1313 // Given
1414 var service = CreateInstance ( ) ;
15-
15+
1616 // When
1717 service . Run ( ) ;
1818
@@ -26,15 +26,15 @@ public void ShouldWaitForEnter()
2626 {
2727 // Given
2828 var service = CreateInstance ( ) ;
29-
29+
3030 // When
3131 service . Run ( ) ;
3232
3333 // Then
3434 _input . Verify ( i => i . ReadLine ( ) ) ;
3535 }
3636
37- private MyService CreateInstance ( ) =>
37+ private MyService CreateInstance ( ) =>
3838 new (
3939 Mock . Of < ILog < MyService > > ( ) ,
4040 _input . Object ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace Lib;
66internal partial class Composition
77{
88 private static void Setup ( ) => DI . Setup ( kind : CompositionKind . Internal )
9- . Bind ( ) . To < Log < TT > > ( )
10- . Bind ( ) . As ( Singleton ) . To < ConsoleAdapter > ( )
11- . Bind ( ) . To < MyService > ( ) ;
9+ . Bind ( ) . To < Log < TT > > ( )
10+ . Bind ( ) . As ( Singleton ) . To < ConsoleAdapter > ( )
11+ . Bind ( ) . To < MyService > ( ) ;
1212}
Original file line number Diff line number Diff line change 22
33namespace Lib ;
44
5- public class ConsoleAdapter : IInput , IOutput
5+ public class ConsoleAdapter : IInput , IOutput
66{
77 public string ? ReadLine ( ) => Console . ReadLine ( ) ;
88
Original file line number Diff line number Diff line change 88 </PropertyGroup >
99
1010 <ItemGroup >
11- <PackageReference Include =" Pure.DI" Version =" 2.1.35 " >
11+ <PackageReference Include =" Pure.DI" Version =" 2.1.36 " >
1212 <PrivateAssets >all</PrivateAssets >
1313 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
1414 </PackageReference >
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ namespace Lib;
22
33public class Log < T > ( IOutput output ) : ILog < T >
44{
5- public void Info ( string message ) =>
5+ public void Info ( string message ) =>
66 output . WriteLine ( $ "{ typeof ( T ) } : { message } ") ;
77}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class MyService(
99 public void Run ( )
1010 {
1111 log . Info ( "Running..." ) ;
12-
12+
1313 output . WriteLine ( "Hello!" ) ;
1414
1515 output . WriteLine ( "Press the Enter key to exit." ) ;
You can’t perform that action at this time.
0 commit comments