alsatian-fluent-assertions
Version:
Fluent assertions extension to Alsatian xUnit framework.
38 lines • 1.65 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const properties_matcher_1 = require("./properties-matcher");
class PropertiesMatcherWithHelpers extends properties_matcher_1.PropertiesMatcher {
constructor(actualValue, nextValue, initial, prevCore, ctxt) {
super(actualValue, nextValue, initial, prevCore, ctxt);
}
has(expected, option1, option2) {
this.setCurrentNode(this.has.name, typeof expected);
if (expected instanceof Array) {
return this.hasElements(expected, option1, option2);
}
else if (expected instanceof Function) {
return this.hasProperty(expected);
}
else if (typeof expected === "string") {
return this.hasProperty(o => o[expected]);
}
else {
this.hasProperties(expected, option1);
}
return this.generateFluentState(this.actualValue, null, false);
}
hasAsserts(expected, location) {
this.setCurrentNode(this.hasAsserts.name, typeof expected);
if (expected instanceof Array) {
return this.hasElements(expected, location, "asserts" /* asserts */);
}
this._properties(this.actualValue, expected, [], "asserts" /* asserts */);
return this.generateFluentState(this.actualValue, null, false);
}
hasAllAsserts(expected) {
this.setCurrentNode(this.hasAllAsserts.name, null);
return this.hasAsserts(expected);
}
}
exports.PropertiesMatcherWithHelpers = PropertiesMatcherWithHelpers;
//# sourceMappingURL=properties-matcher-with-helpers.js.map