File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
fflib-sample-code/src/classes Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,18 @@ private class OpportunitiesServiceTest
50
50
mocks .when (selectorMock .sObjectType ()).thenReturn (Opportunity .SObjectType );
51
51
mocks .when (selectorMock .selectByIdWithProducts (testOppsSet )).thenReturn (testOppsList );
52
52
mocks .stopStubbing ();
53
- Decimal discountPercent = 10 ;
54
53
Application .UnitOfWork .setMock (uowMock );
55
54
Application .Domain .setMock (domainMock );
56
55
Application .Selector .setMock (selectorMock );
57
56
58
57
// When
59
- OpportunitiesService .applyDiscounts (testOppsSet , discountPercent );
58
+ OpportunitiesService .applyDiscounts (testOppsSet , 10 );
60
59
61
60
// Then
62
61
((IOpportunitiesSelector )
63
62
mocks .verify (selectorMock )).selectByIdWithProducts (testOppsSet );
64
63
((IOpportunities )
65
- mocks .verify (domainMock )).applyDiscount (discountPercent , uowMock );
64
+ mocks .verify (domainMock )).applyDiscount (10 , uowMock );
66
65
((fflib_ISObjectUnitOfWork )
67
66
mocks .verify (uowMock , 1 )).commitWork ();
68
67
}
Original file line number Diff line number Diff line change @@ -55,8 +55,11 @@ private class OpportunitiesTest
55
55
56
56
// Then
57
57
((fflib_ISObjectUnitOfWork )
58
- mocks .verify (uowMock , 1 )).registerDirty (opp );
59
- System .assertEquals (900 , opp .Amount );
58
+ mocks .verify (uowMock , 1 )).registerDirty (
59
+ fflib_Match .sObjectWith (
60
+ new Map <SObjectField , Object >{
61
+ Opportunity .Id = > opp .Id ,
62
+ Opportunity .Amount = > 900 } ));
60
63
}
61
64
62
65
@IsTest
You can’t perform that action at this time.
0 commit comments