Additional tests for dice selection.

This commit is contained in:
Oliver Rümpelein 2021-01-02 13:55:18 +01:00
parent 00f7e30b41
commit 3f6f9f795f

View file

@ -197,6 +197,22 @@ describe("DS4 Rools with multiple dice and no modifiers.", () => {
new RollResult(40, RollResultStatus.SUCCESS, [1, 20, 15]), new RollResult(40, RollResultStatus.SUCCESS, [1, 20, 15]),
); );
}); });
it("Should properly maximize throw result with all dice success.", () => {
const rollProvider = mockMultipleThrows([15, 4, 12]);
expect(rollCheckMultipleDice(46, {}, rollProvider)).toEqual(
new RollResult(31, RollResultStatus.SUCCESS, [15, 12, 4]),
);
});
it("Should properly maximize throw result with one dice a failure.", () => {
const rollProvider = mockMultipleThrows([15, 8, 20]);
expect(rollCheckMultipleDice(46, {}, rollProvider)).toEqual(
new RollResult(35, RollResultStatus.SUCCESS, [20, 15, 8]),
);
});
}); });
describe("DS4 Rools with multiple dice and min/max modifiers.", () => { describe("DS4 Rools with multiple dice and min/max modifiers.", () => {