Skip to content

Commit

Permalink
replace old testsuite for check date
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 5, 2020
1 parent 9c42431 commit c880f3e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 61 deletions.
20 changes: 20 additions & 0 deletions timezone/test/Timezone_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,24 @@
expect(subject.GetTimezoneForLanguage("Klingon", "default")).to eq "default"
end
end

describe "#CheckDate" do
it "returns true if date is valid" do
expect(subject.CheckDate("1", "1", "2000")).to eq true
expect(subject.CheckDate("29", "2", "2000")).to eq true
end

it "returns false if invalid date is passed" do
expect(subject.CheckDate("0", "1", "2000")).to eq false
expect(subject.CheckDate("29", "2", "2001")).to eq false
expect(subject.CheckDate("29", "13", "2001")).to eq false
expect(subject.CheckDate("", "13", "2001")).to eq false
expect(subject.CheckDate("1", "13", "string")).to eq false
expect(subject.CheckDate(nil, nil, "string")).to eq false
end

it "returns false if date is newer then year 2032" do
expect(subject.CheckDate("1", "1", "2033")).to eq false
end
end
end
Empty file.
10 changes: 0 additions & 10 deletions timezone/testsuite/tests/CheckDate.out

This file was deleted.

51 changes: 0 additions & 51 deletions timezone/testsuite/tests/CheckDate.rb

This file was deleted.

0 comments on commit c880f3e

Please sign in to comment.