Skip to content

Commit

Permalink
Add test for new Period#equals behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogier Schouten committed Mar 14, 2016
1 parent 405ee73 commit b927bbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/test/test-period.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,12 @@ describe("Period", function(): void {
});

describe("equals()", (): void => {
it("should return false for periods with different reference", (): void => {
it("should return false for periods with different reference but same result", (): void => {
const p = new Period(new DateTime("2014-01-01T00:00:00 UTC"), 1, TimeUnit.Hour, PeriodDst.RegularLocalTime);
const q = new Period(new DateTime("2015-02-02T00:00:00 UTC"), 1, TimeUnit.Hour, PeriodDst.RegularLocalTime);
expect(p.equals(q)).to.equal(true);
});
it("should return false for periods with different reference with different result", (): void => {
const p = new Period(new DateTime("2014-01-01T00:00:00 UTC"), 1, TimeUnit.Hour, PeriodDst.RegularLocalTime);
const q = new Period(new DateTime("2014-01-01T00:00:01 UTC"), 1, TimeUnit.Hour, PeriodDst.RegularLocalTime);
expect(p.equals(q)).to.equal(false);
Expand Down

0 comments on commit b927bbe

Please sign in to comment.