UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

32 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BusinessRuleDetected = void 0; const tiny_types_1 = require("tiny-types"); const model_1 = require("../model"); const screenplay_1 = require("../screenplay"); const DomainEvent_1 = require("./DomainEvent"); /** * Emitted by [@serenity-js/cucumber](https://serenity-js.org/api/cucumber) * when a [business rule](https://cucumber.io/docs/gherkin/reference/#rule) is detected. * * @group Events */ class BusinessRuleDetected extends DomainEvent_1.DomainEvent { sceneId; details; rule; static fromJSON(o) { return new BusinessRuleDetected(model_1.CorrelationId.fromJSON(o.sceneId), model_1.ScenarioDetails.fromJSON(o.details), model_1.BusinessRule.fromJSON(o.rule), screenplay_1.Timestamp.fromJSON(o.timestamp)); } constructor(sceneId, details, rule, timestamp) { super(timestamp); this.sceneId = sceneId; this.details = details; this.rule = rule; (0, tiny_types_1.ensure)('sceneId', sceneId, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('details', details, (0, tiny_types_1.isDefined)()); (0, tiny_types_1.ensure)('rule', rule, (0, tiny_types_1.isDefined)()); } } exports.BusinessRuleDetected = BusinessRuleDetected; //# sourceMappingURL=BusinessRuleDetected.js.map