def test_calculate_hit_probabilities_for_one_shot_of_vanilla_BS13_unit_targeting_unit_under_cover_with_mimetism_minus3_with_combi_in_bad_range(
        self, ):  # noqa
        encounter = Encounter({
            "shooter":
            (UnitBuilder().vanilla().ballistics(13).combi_rifle_b1().build()),
            "target":
            (UnitBuilder().vanilla().partial_cover().mimetism().build()),
            "distance":
            CombiRifle.BadRange
        })

        result = encounter.compute()

        assert result["shooter_hits"] == 0.05
    def test_calculate_hit_probabilities_for_one_shot_of_vanilla_BS13_unit_targeting_vanilla_unit_with_combi_in_good_range(
        self, ):  # noqa

        encounter = Encounter({
            "shooter":
            (UnitBuilder().vanilla().ballistics(13).combi_rifle_b1().build()),
            "target":
            UnitBuilder().vanilla().build(),
            "distance":
            CombiRifle.GoodRange
        })

        result = encounter.compute()

        assert result["shooter_hits"] == 0.8
    def test_calculate_hit_probabilities_for_one_shot_of_vanilla_BS13_unit_targeting_vanilla_unit_with_null_weapon(
            self):  # noqa

        encounter = Encounter({
            "shooter":
            UnitBuilder().vanilla().ballistics(13).build(),
            "target":
            UnitBuilder().vanilla().armor(1).build(),
            "distance":
            None
        })

        result = encounter.compute()

        assert result["shooter_hits"] == 0.65
    def test_calculate_wound_probabilities_for_one_shot_of_vanilla_BS13_unit_targeting_vanilla_unit_with_combi(
            self):  # noqa
        encounter = Encounter({
            "shooter":
            UnitBuilder().vanilla().ballistics(13).build(),
            "target":
            UnitBuilder().vanilla().build(),
            "distance":
            1
        })

        result = encounter.compute()

        assert result["no_wounds"] == 0.65
        assert result["one_wound"] == 0.65
        assert result["two_wounds"] == 0.65