diff --git a/src/Vts.Test/MonteCarlo/Detectors/pMCdMCDAWOneLayerDetectorsTests.cs b/src/Vts.Test/MonteCarlo/Detectors/pMCdMCDAWOneLayerDetectorsTests.cs index f1c1e33e..5b1ccf05 100644 --- a/src/Vts.Test/MonteCarlo/Detectors/pMCdMCDAWOneLayerDetectorsTests.cs +++ b/src/Vts.Test/MonteCarlo/Detectors/pMCdMCDAWOneLayerDetectorsTests.cs @@ -491,6 +491,59 @@ public void Validate_pMC_DAW_ROfFx_nonzero_perturbation_one_layer_tissue() Assert.AreEqual(89, postProcessedOutput.pMC_R_fx_TallyCount); } + [Test] + public void Test_Analog_absorption_weighting_type_throws_argument_exception() + { + var test1 = new DMuaDetectorTest(); + Assert.Throws(() => + { + try + { + test1.SetAbsorbAction(AbsorptionWeightingType.Analog); + } + catch (Exception e) + { + Assert.AreEqual("Analog is not allowed with this detector (Parameter 'awt')", e.Message); + throw; + } + }); + var test2 = new DMusDetectorTest(); + Assert.Throws(() => + { + try + { + test2.SetAbsorbAction(AbsorptionWeightingType.Analog); + } + catch (Exception e) + { + Assert.AreEqual("Analog is not allowed with this detector (Parameter 'awt')", e.Message); + throw; + } + }); + } + + /// + /// Expose protected method in a new class that inherits the class under test + /// + public class DMuaDetectorTest : dMCdROfRhodMuaDetector + { + public new void SetAbsorbAction(AbsorptionWeightingType awt) + { + base.SetAbsorbAction(awt); + } + } + + /// + /// Expose protected method in a new class that inherits the class under test + /// + public class DMusDetectorTest : dMCdROfRhodMusDetector + { + public new void SetAbsorbAction(AbsorptionWeightingType awt) + { + base.SetAbsorbAction(awt); + } + } + } }