@@ -12,41 +12,41 @@ interface Calculator {
1212test ( 'not calling a method correctly asserts the call count' , t => {
1313 const calculator = Substitute . for < Calculator > ( )
1414
15- calculator [ didNotReceive ] ( ) . add ( 1 , 1 )
16- t . throws ( ( ) => calculator [ received ] ( ) . add ( 1 , 1 ) , { instanceOf : SubstituteException } )
17- t . throws ( ( ) => calculator [ received ] ( ) . add ( Arg . all ( ) ) , { instanceOf : SubstituteException } )
15+ calculator . didNotReceive ( ) . add ( 1 , 1 )
16+ t . throws ( ( ) => calculator . received ( ) . add ( 1 , 1 ) , { instanceOf : SubstituteException } )
17+ t . throws ( ( ) => calculator . received ( ) . add ( Arg . all ( ) ) , { instanceOf : SubstituteException } )
1818} )
1919
2020test ( 'not getting a property correctly asserts the call count' , t => {
2121 const calculator = Substitute . for < Calculator > ( )
2222
23- calculator [ didNotReceive ] ( ) . isEnabled
24- t . throws ( ( ) => calculator [ received ] ( 1 ) . isEnabled , { instanceOf : SubstituteException } )
25- t . throws ( ( ) => calculator [ received ] ( ) . isEnabled , { instanceOf : SubstituteException } )
23+ calculator . didNotReceive ( ) . isEnabled
24+ t . throws ( ( ) => calculator . received ( 1 ) . isEnabled , { instanceOf : SubstituteException } )
25+ t . throws ( ( ) => calculator . received ( ) . isEnabled , { instanceOf : SubstituteException } )
2626} )
2727
2828test ( 'not setting a property correctly asserts the call count' , t => {
2929 const calculator = Substitute . for < Calculator > ( )
3030
31- calculator [ didNotReceive ] ( ) . isEnabled = true
32- t . throws ( ( ) => calculator [ received ] ( 1 ) . isEnabled = true , { instanceOf : SubstituteException } )
33- t . throws ( ( ) => calculator [ received ] ( ) . isEnabled = true , { instanceOf : SubstituteException } )
31+ calculator . didNotReceive ( ) . isEnabled = true
32+ t . throws ( ( ) => calculator . received ( 1 ) . isEnabled = true , { instanceOf : SubstituteException } )
33+ t . throws ( ( ) => calculator . received ( ) . isEnabled = true , { instanceOf : SubstituteException } )
3434} )
3535
3636test ( 'not calling a method with mock correctly asserts the call count' , t => {
3737 const calculator = Substitute . for < Calculator > ( )
38- calculator . add ( 1 , 1 ) [ returns ] ( 2 )
38+ calculator . add ( 1 , 1 ) . returns ( 2 )
3939
40- calculator [ didNotReceive ] ( ) . add ( 1 , 1 )
41- t . throws ( ( ) => calculator [ received ] ( 1 ) . add ( 1 , 1 ) , { instanceOf : SubstituteException } )
42- t . throws ( ( ) => calculator [ received ] ( ) . add ( Arg . all ( ) ) , { instanceOf : SubstituteException } )
40+ calculator . didNotReceive ( ) . add ( 1 , 1 )
41+ t . throws ( ( ) => calculator . received ( 1 ) . add ( 1 , 1 ) , { instanceOf : SubstituteException } )
42+ t . throws ( ( ) => calculator . received ( ) . add ( Arg . all ( ) ) , { instanceOf : SubstituteException } )
4343} )
4444
4545test ( 'not getting a property with mock correctly asserts the call count' , t => {
4646 const calculator = Substitute . for < Calculator > ( )
47- calculator . isEnabled [ returns ] ( true )
47+ calculator . isEnabled . returns ( true )
4848
49- calculator [ didNotReceive ] ( ) . isEnabled
50- t . throws ( ( ) => calculator [ received ] ( 1 ) . isEnabled , { instanceOf : SubstituteException } )
51- t . throws ( ( ) => calculator [ received ] ( ) . isEnabled , { instanceOf : SubstituteException } )
49+ calculator . didNotReceive ( ) . isEnabled
50+ t . throws ( ( ) => calculator . received ( 1 ) . isEnabled , { instanceOf : SubstituteException } )
51+ t . throws ( ( ) => calculator . received ( ) . isEnabled , { instanceOf : SubstituteException } )
5252} )
0 commit comments