WeatherDice.java

1
package com.takenoko.weather;
2
3
import java.util.Random;
4
5
/** Implementation of the WeatherDice of the game, it has 6 sides and each side is a weather. */
6
public class WeatherDice extends Dice {
7
    /** Default Constructor */
8
    public WeatherDice() {
9
        super(WeatherFactory.values().length);
10
    }
11
12
    /**
13
     * Specify the Random Generator
14
     *
15
     * @param random random number generator
16
     */
17
    public WeatherDice(Random random) {
18
        super(WeatherFactory.values().length, random);
19
    }
20
21
    /**
22
     * Roll the dice to get a Weather
23
     *
24
     * @return the result of the roll
25
     */
26
    public Weather rollWeather() {
27 1 1. rollWeather : replaced return value with null for com/takenoko/weather/WeatherDice::rollWeather → KILLED
        return WeatherFactory.values()[super.roll()].createWeather();
28
    }
29
30
    public Weather peekWeather() {
31 1 1. peekWeather : replaced return value with null for com/takenoko/weather/WeatherDice::peekWeather → KILLED
        return WeatherFactory.values()[super.peek()].createWeather();
32
    }
33
}

Mutations

27

1.1
Location : rollWeather
Killed by : com.takenoko.weather.WeatherDiceTest.[engine:junit-jupiter]/[class:com.takenoko.weather.WeatherDiceTest]/[nested-class:RollWeather]/[method:shouldReturnAWeatherWhenRandomIsBetween0And5()]
replaced return value with null for com/takenoko/weather/WeatherDice::rollWeather → KILLED

31

1.1
Location : peekWeather
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced return value with null for com/takenoko/weather/WeatherDice::peekWeather → KILLED

Active mutators

Tests examined


Report generated by PIT 1.8.0