amoss icon indicating copy to clipboard operation
amoss copied to clipboard

Implement 'withField.setTo'

Open bobalicious opened this issue 4 years ago • 0 comments

withFieldsSetTo is a very useful method for checking that an SObject has certain fields set to certain values, but it can be a little long-winded for checking a single value.

E.g.

.when( 'exampleMethod' )
.withParameterNamed( 'sObjectParameter' ).withFieldsSetTo( new Map<String,Object>{ 'IsPersonAccount' => true } )

It would be preferable to have a shorter-hand version of it that allows a single field value to be checked:

E.g.

.when( 'exampleMethod' )
.withParameterNamed( 'sObjectParameter' ).withField( 'IsPersonAccount' ).setTo( true )

bobalicious avatar Feb 09 '21 07:02 bobalicious