added proper DayCalculator test group
This commit is contained in:
parent
27f99d9866
commit
4ede1c3efd
1 changed files with 284 additions and 282 deletions
|
@ -3,7 +3,8 @@ import 'package:test/test.dart';
|
|||
import 'package:ohthatsa/util/DayCalculator.dart';
|
||||
|
||||
void main() {
|
||||
group("DayCalculator getYearValue() ", () {
|
||||
group("DayCalculator", () {
|
||||
group("getYearValue() ", () {
|
||||
test("1897", () {
|
||||
expect(DayCalculator.getYearValue(1897), equals(2));
|
||||
});
|
||||
|
@ -17,7 +18,7 @@ void main() {
|
|||
expect(DayCalculator.getYearValue(2132), equals(5));
|
||||
});
|
||||
});
|
||||
group("DayCalculator getMonthValue() raw int", () {
|
||||
group("getMonthValue() raw int", () {
|
||||
test("January", () {
|
||||
expect(DayCalculator.getMonthValue(0), equals(0));
|
||||
});
|
||||
|
@ -55,7 +56,7 @@ void main() {
|
|||
expect(DayCalculator.getMonthValue(11), equals(5));
|
||||
});
|
||||
});
|
||||
group("DayCalculator getMonthValue() Month.i", () {
|
||||
group("getMonthValue() Month.i", () {
|
||||
test("January", () {
|
||||
expect(DayCalculator.getMonthValue(Months.january.i), equals(0));
|
||||
});
|
||||
|
@ -93,7 +94,7 @@ void main() {
|
|||
expect(DayCalculator.getMonthValue(Months.december.i), equals(5));
|
||||
});
|
||||
});
|
||||
group("DayCalculator getMonthValueByString()", () {
|
||||
group("getMonthValueByString()", () {
|
||||
test("January", () {
|
||||
expect(DayCalculator.getMonthValueByString("January"), equals(0));
|
||||
});
|
||||
|
@ -131,7 +132,7 @@ void main() {
|
|||
expect(DayCalculator.getMonthValueByString("December"), equals(5));
|
||||
});
|
||||
});
|
||||
group("DayCalculator getMonthValueByString()", () {
|
||||
group("getMonthValueByString()", () {
|
||||
test("January", () {
|
||||
expect(DayCalculator.getMonthValueByString(Months.january.string), equals(0));
|
||||
});
|
||||
|
@ -169,7 +170,7 @@ void main() {
|
|||
expect(DayCalculator.getMonthValueByString(Months.december.string), equals(5));
|
||||
});
|
||||
});
|
||||
group("DayCalculator getCenturyValue()", () {
|
||||
group("getCenturyValue()", () {
|
||||
group("1700s", () {
|
||||
test("1700", () {
|
||||
expect(DayCalculator.getCenturyValue(1700), equals(4));
|
||||
|
@ -248,7 +249,7 @@ void main() {
|
|||
});
|
||||
});
|
||||
});
|
||||
group("DayCalculator isLeapYear()", () {
|
||||
group("isLeapYear()", () {
|
||||
test("1800", () {
|
||||
expect(DayCalculator.isLeapYear(1800), equals(false));
|
||||
});
|
||||
|
@ -316,4 +317,5 @@ void main() {
|
|||
expect(DayCalculator.isLeapYear(2400), equals(true));
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue