コード例 #1
0
 def test_validate_starting_seniles_must_be_0_or_greater_with_value_of_minus_1(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be 0 or greater",
                      validation.validate_starting_seniles(-1))
コード例 #2
0
 def test_validate_starting_seniles_must_be_0_or_greater_with_value_of_0(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_starting_seniles(0))
コード例 #3
0
 def test_initialisation_values(self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(1, validation.min_generations)
     self.assertEqual(100, validation.max_generations)
コード例 #4
0
 def test_validate_starting_adults_must_be_0_or_greater_with_value_of_1(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_starting_adults(1))
コード例 #5
0
 def test_validate_senile_survival_rate_must_be_0_or_greater_for_value_of_1(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_senile_survival_rate(1))
コード例 #6
0
 def test_validate_senile_survival_rate_must_be_1_or_less_for_value_of_2(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be 1 or less",
                      validation.validate_senile_survival_rate(2))
コード例 #7
0
 def test_validate_adult_birth_rate_must_be_0_or_greater_for_value_of_0(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_adult_birth_rate(0))
コード例 #8
0
 def test_validate_senile_survival_rate_must_be_0_or_greater_for_value_of_minus_one(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be 0 or greater",
                      validation.validate_senile_survival_rate(-1))
コード例 #9
0
 def test_validate_disease_trigger_must_be_greater_than_0_with_value_of_1(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_disease_trigger(1))
コード例 #10
0
 def test_validate_disease_trigger_must_be_greater_than_0_with_value_of_0(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be greater than 0",
                      validation.validate_disease_trigger(0))
コード例 #11
0
 def test_validate_generations_ok_for_value_of_100(self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual(None, validation.validate_generations(100))
コード例 #12
0
 def test_validate_generations_cannot_be_more_than_max_for_value_of_101(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be equal to or less than 100",
                      validation.validate_generations(101))
コード例 #13
0
 def test_validate_generations_cannot_be_less_than_min_for_value_of_minus_one(
         self):
     validation = ModelRunOptionsValidation(1, 100)
     self.assertEqual("Must be equal to or greater than 1",
                      validation.validate_generations(-1))