@@ -13,17 +13,49 @@ namespace CodeOfChaos.Testing.TUnit;
1313// ---------------------------------------------------------------------------------------------------------------------
1414// ReSharper disable once InconsistentNaming
1515public static class TUnitExtensionsServiceCollection {
16- public static InvokableValueAssertionBuilder < ServiceCollection > ContainsServiceType < TServiceType > ( this IValueSource < ServiceCollection > valueSource , [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = "" ) {
17- return valueSource . RegisterAssertion (
18- new ContainsServiceTypeCondition < TServiceType > ( ) ,
19- [ doNotPopulateThisValue1 ]
20- ) ;
21- }
16+ #region ContainsService
17+ public static InvokableValueAssertionBuilder < IServiceCollection > ContainsServiceType < TServiceType > ( this IValueSource < IServiceCollection > valueSource , [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = "" )
18+ => valueSource . RegisterAssertion ( new ContainsServiceTypeCondition ( typeof ( TServiceType ) ) , [ doNotPopulateThisValue1 ] ) ;
19+
20+ public static InvokableValueAssertionBuilder < IServiceCollection > ContainsServiceType ( this IValueSource < IServiceCollection > valueSource , Type serviceType , [ CallerArgumentExpression ( nameof ( serviceType ) ) ] string doNotPopulateThisValue1 = "" )
21+ => valueSource . RegisterAssertion ( new ContainsServiceTypeCondition ( serviceType ) , [ doNotPopulateThisValue1 ] ) ;
22+
23+ public static InvokableValueAssertionBuilder < IServiceCollection > DoesNotContainServiceType < TServiceType > ( this IValueSource < IServiceCollection > valueSource , [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = "" )
24+ => valueSource . RegisterAssertion ( new DoesNotContainServiceTypeCondition ( typeof ( TServiceType ) ) , [ doNotPopulateThisValue1 ] ) ;
25+
26+ public static InvokableValueAssertionBuilder < IServiceCollection > DoesNotContainServiceType ( this IValueSource < IServiceCollection > valueSource , Type serviceType , [ CallerArgumentExpression ( nameof ( serviceType ) ) ] string doNotPopulateThisValue1 = "" )
27+ => valueSource . RegisterAssertion ( new DoesNotContainServiceTypeCondition ( serviceType ) , [ doNotPopulateThisValue1 ] ) ;
28+ #endregion
29+
30+ #region ContainsServiceImplementation
31+ public static InvokableValueAssertionBuilder < IServiceCollection > ContainsServiceImplementation < TService , TImplementation > (
32+ this IValueSource < IServiceCollection > valueSource ,
33+ [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = ""
34+ )
35+ => valueSource . RegisterAssertion ( new ContainsServiceImplementationCondition ( typeof ( TService ) , typeof ( TImplementation ) ) , [ doNotPopulateThisValue1 ] ) ;
2236
23- public static InvokableValueAssertionBuilder < ServiceCollection > DoesNotContainServiceType < TServiceType > ( this IValueSource < ServiceCollection > valueSource , [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = "" ) {
24- return valueSource . RegisterAssertion (
25- new DoesNotContainServiceTypeCondition < TServiceType > ( ) ,
26- [ doNotPopulateThisValue1 ]
27- ) ;
28- }
37+ public static InvokableValueAssertionBuilder < IServiceCollection > ContainsServiceImplementation (
38+ this IValueSource < IServiceCollection > valueSource ,
39+ Type serviceType ,
40+ Type implementationType ,
41+ [ CallerArgumentExpression ( nameof ( serviceType ) ) ] string doNotPopulateThisValue1 = ""
42+ )
43+ => valueSource . RegisterAssertion ( new ContainsServiceImplementationCondition ( serviceType , implementationType ) , [ doNotPopulateThisValue1 ] ) ;
44+
45+ public static InvokableValueAssertionBuilder < IServiceCollection > DoesNotContainServiceImplementation < TService , TImplementation > (
46+ this IValueSource < IServiceCollection > valueSource ,
47+ [ CallerArgumentExpression ( nameof ( valueSource ) ) ] string doNotPopulateThisValue1 = ""
48+ )
49+ => valueSource . RegisterAssertion ( new DoesNotContainServiceImplementationCondition ( typeof ( TService ) , typeof ( TImplementation ) ) , [ doNotPopulateThisValue1 ] ) ;
50+
51+ public static InvokableValueAssertionBuilder < IServiceCollection > DoesNotContainServiceImplementation (
52+ this IValueSource < IServiceCollection > valueSource ,
53+ Type serviceType ,
54+ Type implementationType ,
55+ [ CallerArgumentExpression ( nameof ( serviceType ) ) ] string doNotPopulateThisValue1 = ""
56+ )
57+ => valueSource . RegisterAssertion ( new DoesNotContainServiceImplementationCondition ( serviceType , implementationType ) , [ doNotPopulateThisValue1 ] ) ;
58+ #endregion
59+
60+
2961}
0 commit comments