mirror of
https://github.com/acamarata/pray-calc-dart.git
synced 2026-07-02 20:00:40 +00:00
Compare commits
No commits in common. "main" and "v1.0.1" have entirely different histories.
1 changed files with 36 additions and 45 deletions
|
|
@ -198,9 +198,7 @@ void main() {
|
||||||
// "March 15" (via their .year/.month/.day fields) produce identical prayer
|
// "March 15" (via their .year/.month/.day fields) produce identical prayer
|
||||||
// times, regardless of what the host machine timezone is.
|
// times, regardless of what the host machine timezone is.
|
||||||
|
|
||||||
test(
|
test('local DateTime and UTC noon for same civil date produce identical times', () {
|
||||||
'local DateTime and UTC noon for same civil date produce identical times',
|
|
||||||
() {
|
|
||||||
// Both express 2024-03-15: local midnight and UTC noon share year/month/day = 2024/3/15
|
// Both express 2024-03-15: local midnight and UTC noon share year/month/day = 2024/3/15
|
||||||
final local = DateTime(2024, 3, 15);
|
final local = DateTime(2024, 3, 15);
|
||||||
final utcNoon = DateTime.utc(2024, 3, 15, 12, 0, 0);
|
final utcNoon = DateTime.utc(2024, 3, 15, 12, 0, 0);
|
||||||
|
|
@ -215,12 +213,9 @@ void main() {
|
||||||
expect(timesNoon.asr, closeTo(timesLocal.asr, 0.0001));
|
expect(timesNoon.asr, closeTo(timesLocal.asr, 0.0001));
|
||||||
expect(timesNoon.maghrib, closeTo(timesLocal.maghrib, 0.0001));
|
expect(timesNoon.maghrib, closeTo(timesLocal.maghrib, 0.0001));
|
||||||
expect(timesNoon.isha, closeTo(timesLocal.isha, 0.0001));
|
expect(timesNoon.isha, closeTo(timesLocal.isha, 0.0001));
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
test(
|
test('UTC midnight and UTC noon for same civil date produce identical times', () {
|
||||||
'UTC midnight and UTC noon for same civil date produce identical times',
|
|
||||||
() {
|
|
||||||
final utcMidnight = DateTime.utc(2024, 3, 15, 0, 0, 0);
|
final utcMidnight = DateTime.utc(2024, 3, 15, 0, 0, 0);
|
||||||
final utcNoon = DateTime.utc(2024, 3, 15, 12, 0, 0);
|
final utcNoon = DateTime.utc(2024, 3, 15, 12, 0, 0);
|
||||||
|
|
||||||
|
|
@ -233,12 +228,9 @@ void main() {
|
||||||
expect(timesNoon.asr, closeTo(timesMid.asr, 0.0001));
|
expect(timesNoon.asr, closeTo(timesMid.asr, 0.0001));
|
||||||
expect(timesNoon.maghrib, closeTo(timesMid.maghrib, 0.0001));
|
expect(timesNoon.maghrib, closeTo(timesMid.maghrib, 0.0001));
|
||||||
expect(timesNoon.isha, closeTo(timesMid.isha, 0.0001));
|
expect(timesNoon.isha, closeTo(timesMid.isha, 0.0001));
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
test(
|
test('angles are identical for local vs UTC noon for the same civil date', () {
|
||||||
'angles are identical for local vs UTC noon for the same civil date',
|
|
||||||
() {
|
|
||||||
final local = DateTime(2024, 6, 15);
|
final local = DateTime(2024, 6, 15);
|
||||||
final utcNoon = DateTime.utc(2024, 6, 15, 12, 0, 0);
|
final utcNoon = DateTime.utc(2024, 6, 15, 12, 0, 0);
|
||||||
|
|
||||||
|
|
@ -249,7 +241,6 @@ void main() {
|
||||||
|
|
||||||
expect(anglesUtcNoon.fajrAngle, closeTo(anglesLocal.fajrAngle, 0.001));
|
expect(anglesUtcNoon.fajrAngle, closeTo(anglesLocal.fajrAngle, 0.001));
|
||||||
expect(anglesUtcNoon.ishaAngle, closeTo(anglesLocal.ishaAngle, 0.001));
|
expect(anglesUtcNoon.ishaAngle, closeTo(anglesLocal.ishaAngle, 0.001));
|
||||||
},
|
});
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue