Make tests and implementation interact.

This commit is contained in:
Oliver Rümpelein 2020-12-30 21:27:41 +01:00
parent 7089178a0d
commit e0b65ca061
7 changed files with 163 additions and 34 deletions

View file

@ -0,0 +1,19 @@
import {
rollCheckSingleDie,
RollOptions,
RollProvider,
RollResult,
RollResultStatus,
} from "../../src/module/rolls/ds4rolls";
describe("DS4 Rolls", () => {
it("Should do a proper single success role", () => {
const rollProvider: RollProvider = jasmine.createSpyObj("rollProvider", ["getNextRoll"]);
rollProvider.getNextRoll = jasmine.createSpy("getNextRoll").and.returnValue(4);
expect(rollCheckSingleDie(12, new RollOptions(), rollProvider)).toEqual(
new RollResult(4, RollResultStatus.SUCCESS, [4]),
);
});
});