Skip to content

Commit

Permalink
test(Number): add.
Browse files Browse the repository at this point in the history
  • Loading branch information
sciborrudnicki committed Feb 26, 2022
1 parent bceb14a commit 32c36d4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/test/number.spec.ts
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);
});
});

0 comments on commit 32c36d4

Please sign in to comment.