@@ -144,7 +144,7 @@ public void should_return_the_matching_parameters()
144144 {
145145 sut . AllParametersMatching ( _organism , pathFrom ( Constants . WILD_CARD_RECURSIVE , INTRACELLULAR , VOLUME ) ) . ShouldOnlyContain ( _volumeLiverCell , _volumeKidneyCell ) ;
146146 sut . AllParametersMatching ( _organism , pathFrom ( Constants . WILD_CARD_RECURSIVE , VOLUME ) ) . ShouldOnlyContain ( _volumeLiver , _volumeKidney , _volumeKidneyCell , _volumeLiverCell , _volumeOrganism ) ;
147- sut . AllParametersMatching ( _organism , pathFrom ( Constants . WILD_CARD_RECURSIVE , _clearance . Name ) ) . ShouldOnlyContain ( _clearance ) ;
147+ sut . AllParametersMatching ( _organism , pathFrom ( Constants . WILD_CARD_RECURSIVE , _clearance . Name ) ) . ShouldOnlyContain ( _clearance ) ;
148148 }
149149 }
150150
@@ -283,7 +283,7 @@ protected override void Because()
283283 [ Observation ]
284284 public void should_return_the_expected_path ( )
285285 {
286- var quantities = new IQuantity [ ] { _volumeLiver , _volumeLiverCell , _clearance , _liverIntracellularMoleculeAmount , _liverRelExp , _volumeLiverCellOtherEntity } ;
286+ var quantities = new IQuantity [ ] { _volumeLiver , _volumeLiverCell , _clearance , _liverIntracellularMoleculeAmount , _liverRelExp , _volumeLiverCellOtherEntity } ;
287287 var expected = quantities . Select ( x => x . EntityPath ( ) ) . ToArray ( ) ;
288288 _result . ShouldOnlyContain ( expected ) ;
289289 }
@@ -301,7 +301,7 @@ protected override void Because()
301301 [ Observation ]
302302 public void should_return_the_expected_path ( )
303303 {
304- var containers = new [ ] { _kidney , _liver , _liverIntracellular , _kidneyIntracellular , _liverIntracellularSubContainer , } ;
304+ var containers = new [ ] { _kidney , _liver , _liverIntracellular , _kidneyIntracellular , _liverIntracellularSubContainer , } ;
305305 var expected = containers . Select ( x => x . EntityPath ( ) ) . ToArray ( ) ;
306306 _result . ShouldOnlyContain ( expected ) ;
307307 }
@@ -319,7 +319,7 @@ protected override void Because()
319319 [ Observation ]
320320 public void should_only_return_parameters_with_a_RHS_formula_defined ( )
321321 {
322- var parameters = new [ ] { _paramWithRHS } ;
322+ var parameters = new [ ] { _paramWithRHS } ;
323323 var expected = parameters . Select ( x => x . EntityPath ( ) ) . ToArray ( ) ;
324324 _result . ShouldOnlyContain ( expected ) ;
325325 }
@@ -419,4 +419,26 @@ public void should_get_the_value_of_the_parameter_as_expected_otherwise()
419419 sut . GetValueByPath ( _simulation , pathFrom ( _liver . Name , INTRACELLULAR , _volumeLiverCell . Name ) , throwIfNotFound : true ) . ShouldBeEqualTo ( 666 ) ;
420420 }
421421 }
422+
423+ public class When_adding_quantities_to_simulation_output_by_path : concern_for_ContainerTask
424+ {
425+ [ Observation ]
426+ public void should_throw_an_exception_if_the_path_does_not_exist_and_throw_flag_is_true ( )
427+ {
428+ The . Action ( ( ) => sut . AddQuantitiesToSimulationOutputByPath ( _simulation , pathFrom ( _liver . Name , INTRACELLULAR , "TOTO" ) , throwIfNotFound : true ) ) . ShouldThrowAn < OSPSuiteException > ( ) ;
429+ }
430+
431+ [ Observation ]
432+ public void should_not_throw_an_exception_if_the_path_does_not_exist_and_the_throw_flag_is_set_to_false ( )
433+ {
434+ sut . AddQuantitiesToSimulationOutputByPath ( _simulation , pathFrom ( _liver . Name , INTRACELLULAR , "TOTO" ) , throwIfNotFound : false ) ;
435+ }
436+
437+ [ Observation ]
438+ public void should_add_quantities_to_output_selections_when_path_is_found ( )
439+ {
440+ sut . AddQuantitiesToSimulationOutputByPath ( _simulation , pathFrom ( _liver . Name , INTRACELLULAR , VOLUME ) , throwIfNotFound : true ) ;
441+ A . CallTo ( ( ) => _simulation . OutputSelections . AddQuantity ( A < IQuantity > . _ ) ) . MustHaveHappened ( 1 , Times . Exactly ) ;
442+ }
443+ }
422444}
0 commit comments