-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bceb14a
commit 32c36d4
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @angular-package/testing. | ||
import { Testing, TestingToBeMatchers } from '@angular-package/testing'; | ||
// Class. | ||
import { Number } from '../lib/number.class'; | ||
|
||
// Initialize. | ||
const testing = new Testing(true, true); | ||
const toBe = new TestingToBeMatchers(); | ||
|
||
testing.describe(`Number.`, () => { | ||
|
||
let min = Math.floor(Math.random() * 10); | ||
let max = Math.floor(Math.random() * 100) + 11; | ||
let minimum = new Number(min); | ||
|
||
beforeEach(() => { | ||
min = Math.floor(Math.random() * 10); | ||
max = Math.floor(Math.random() * 100) + 11; | ||
minimum = new Number(min); | ||
}); | ||
|
||
testing | ||
.toBeClass(Number) | ||
.toBeNumberType(new Number(min).valueOf()) | ||
.toEqual(`Must be equal to ${min}`, new Number(min).valueOf(), min) | ||
|
||
.it(`.create()`, () => { | ||
const customNumber = Number.create(min); | ||
toBe | ||
.instance(customNumber, Number) | ||
.numberBetween(customNumber.valueOf(), min, max); | ||
}); | ||
}); |