@Test public void testAge30AndNonSmoker() { User user = TestObjectMother.createTestUserForAgeAndSmokerStatusAndHeightAndWeight(30, false, 70, 76); Double mortalityRate = MortalityRateAndRiskFinder.findMortalityRiskFactor(user); Assert.assertNotNull(mortalityRate); Assert.assertEquals(new Double("1.0058"), mortalityRate); }
@Test public void testAge48AndSmoker() { User user = TestObjectMother.createTestUserForAgeAndSmokerStatusAndHeightAndWeight(48, true, 64, 86); Double mortalityRate = MortalityRateAndRiskFinder.findMortalityRiskFactor(user); Assert.assertNotNull(mortalityRate); Assert.assertEquals(new Double("66.61174"), mortalityRate); }
@Test public void testIntegrationScenario() { User user = TestObjectMother.createTestUserForAgeAndSmokerStatusAndHeightAndWeight(37, false, 65, 56); user.setGender("Male"); Double mortalityRate = MortalityRateAndRiskFinder.findMortalityRiskFactor(user); Assert.assertNotNull(mortalityRate); Assert.assertEquals(new Double("2.129599"), mortalityRate); }