class TestRandomSelector(TestSelectorCommon):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.sut = RandomSelector()

    def test_random_selection_should_work(self):
        # Given:
        self.rule_population_mock.get_random_rules.return_value = [self.expected_rule]

        # When:
        selected_rule = self.sut.select(
            self.service_mock, self.grammar_statistics_mock, self.rule_population_mock)

        # Then:
        assert_that(selected_rule, is_(equal_to(self.expected_rule)))
        self.rule_population_mock.get_random_rules.assert_called_once_with(
            self.randomizer_mock, False, 1)
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.sut = RandomSelector()