()
| 18 | } |
| 19 | |
| 20 | protected tests() { |
| 21 | test("NoRequirements should always return true regardless of what is put in", () => { |
| 22 | ok(this.noReq.requirementsAreMet(undefined), "No requirements returned false, which should never happen"); |
| 23 | }); |
| 24 | |
| 25 | test("ProductionRequirements should return false for an empty or undefined argument", () => { |
| 26 | strictEqual(this.prod.requirementsAreMet(undefined), false, "ProdRequirements incorrectly returned true for an undefined object"); |
| 27 | strictEqual(this.prod.requirementsAreMet({}), false, "ProdRequirements incorrectly returned true for an empty object"); |
| 28 | }); |
| 29 | |
| 30 | test("ProductionRequirements should return false for a subset of properties that don't meet the full property set", () => { |
| 31 | let partiallyFilledProps = { |
| 32 | a: "bar", |
| 33 | b: "baz" |
| 34 | } as { [key: string]: string | number | boolean }; |
| 35 | strictEqual(this.prod.requirementsAreMet(partiallyFilledProps), false, "requirementsAreMet incorrectly returned true when the contextProps passed in did not match those injected at construction"); |
| 36 | }); |
| 37 | |
| 38 | test("ProductionRequirements should return true for properties that meet exactly the requirements", () => { |
| 39 | let fullyFilledProps = { |
| 40 | a: "bar", |
| 41 | b: "baz", |
| 42 | c: "foo" |
| 43 | } as { [key: string]: string | number | boolean }; |
| 44 | strictEqual(this.prod.requirementsAreMet(fullyFilledProps), true, "requirementsAreMet incorrectly returned false when the contextProps passed in matched the requirements injected at construction"); |
| 45 | }); |
| 46 | |
| 47 | test("ProductionRequirements should return true for props that exceed the props injected at constructin", () => { |
| 48 | let excessProps = { |
| 49 | a: "a", |
| 50 | b: "b", |
| 51 | c: "c", |
| 52 | d: "d" |
| 53 | } as { [key: string]: string | number | boolean }; |
| 54 | strictEqual(this.prod.requirementsAreMet(excessProps), true, "requirementsAreMet incorrectly returned false when the contextProps passed in exceeded the requirements injected at construction"); |
| 55 | }); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | (new ContextTests()).runTests(); |
nothing calls this directly
no test coverage detected