File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
IntelliTect.TestTools.TestFramework/IntelliTect.TestTools.TestFramework.Tests Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 11namespace IntelliTect . TestTools . TestFramework . Tests
22{
3- public class ExampleDataThing
3+ public interface IExampleDataInterface
4+ {
5+ string Testing { get ; set ; }
6+ }
7+
8+ public class ExampleDataThing : IExampleDataInterface
49 {
510 public string Testing { get ; set ; } = "Testing" ;
611 }
Original file line number Diff line number Diff line change @@ -105,6 +105,26 @@ public void FetchByServiceForExecuteArg()
105105 . ExecuteTestCase ( ) ;
106106 }
107107
108+ [ Fact ]
109+ public void FetchByImplementationForExecuteArg ( )
110+ {
111+ TestBuilder builder = new TestBuilder ( ) ;
112+ builder
113+ . AddDependencyInstance < IExampleDataInterface > ( new ExampleDataThing ( ) )
114+ . AddTestBlock < ExampleTestBlockWithExecuteArgForInterface > ( )
115+ . ExecuteTestCase ( ) ;
116+ }
117+
118+ [ Fact ]
119+ public void FetchByImplementationAndTypeForExecuteArg ( )
120+ {
121+ TestBuilder builder = new TestBuilder ( ) ;
122+ builder
123+ . AddDependencyService < IExampleDataInterface , ExampleDataThing > ( )
124+ . AddTestBlock < ExampleTestBlockWithExecuteArgForInterface > ( )
125+ . ExecuteTestCase ( ) ;
126+ }
127+
108128 // This test probably isn't necessary. This is MS DI out-of-the-box functionality
109129 [ Fact ]
110130 public void FetchByFactoryForConstructor ( )
@@ -375,6 +395,15 @@ public void Execute(ExampleDataThing input)
375395 }
376396 }
377397
398+ public class ExampleTestBlockWithExecuteArgForInterface : ITestBlock
399+ {
400+ public void Execute ( IExampleDataInterface input )
401+ {
402+ if ( input == null ) throw new ArgumentNullException ( nameof ( input ) ) ;
403+ Assert . Equal ( "Testing" , input . Testing ) ;
404+ }
405+ }
406+
378407 public class ExampleTestBlockWithPropertyForOwnType : ITestBlock
379408 {
380409 public ExampleDataThing Input { get ; set ; }
You can’t perform that action at this time.
0 commit comments