Fix tests
This commit is contained in:
parent
e730d36cc9
commit
57034e48d5
|
@ -173,7 +173,6 @@ impl From<Vec<Record<TraxRecord>>> for GroupedRecords {
|
||||||
mod test {
|
mod test {
|
||||||
use super::GroupedRecords;
|
use super::GroupedRecords;
|
||||||
use chrono::{FixedOffset, NaiveDate, TimeZone};
|
use chrono::{FixedOffset, NaiveDate, TimeZone};
|
||||||
use chrono_tz::America::Anchorage;
|
|
||||||
use dimensioned::si::{KG, M, S};
|
use dimensioned::si::{KG, M, S};
|
||||||
use emseries::{Record, RecordId};
|
use emseries::{Record, RecordId};
|
||||||
use ft_core::{Steps, TimeDistance, TraxRecord, Weight};
|
use ft_core::{Steps, TimeDistance, TraxRecord, Weight};
|
||||||
|
@ -181,19 +180,30 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn groups_records() {
|
fn groups_records() {
|
||||||
let records = vec![
|
let records = vec![
|
||||||
TraxRecord::Steps(Steps {
|
Record {
|
||||||
|
id: RecordId::default(),
|
||||||
|
data: TraxRecord::Steps(Steps {
|
||||||
date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
|
date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
|
||||||
count: 1500,
|
count: 1500,
|
||||||
}),
|
}),
|
||||||
TraxRecord::Weight(Weight {
|
},
|
||||||
|
Record {
|
||||||
|
id: RecordId::default(),
|
||||||
|
data: TraxRecord::Weight(Weight {
|
||||||
date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
|
date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
|
||||||
weight: 85. * KG,
|
weight: 85. * KG,
|
||||||
}),
|
}),
|
||||||
TraxRecord::Weight(Weight {
|
},
|
||||||
|
Record {
|
||||||
|
id: RecordId::default(),
|
||||||
|
data: TraxRecord::Weight(Weight {
|
||||||
date: NaiveDate::from_ymd_opt(2023, 10, 14).unwrap(),
|
date: NaiveDate::from_ymd_opt(2023, 10, 14).unwrap(),
|
||||||
weight: 86. * KG,
|
weight: 86. * KG,
|
||||||
}),
|
}),
|
||||||
TraxRecord::BikeRide(TimeDistance {
|
},
|
||||||
|
Record {
|
||||||
|
id: RecordId::default(),
|
||||||
|
data: TraxRecord::BikeRide(TimeDistance {
|
||||||
datetime: FixedOffset::west_opt(10 * 60 * 60)
|
datetime: FixedOffset::west_opt(10 * 60 * 60)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.with_ymd_and_hms(2019, 6, 15, 12, 0, 0)
|
.with_ymd_and_hms(2019, 6, 15, 12, 0, 0)
|
||||||
|
@ -202,7 +212,10 @@ mod test {
|
||||||
duration: Some(150. * S),
|
duration: Some(150. * S),
|
||||||
comments: Some("Test Comments".to_owned()),
|
comments: Some("Test Comments".to_owned()),
|
||||||
}),
|
}),
|
||||||
TraxRecord::BikeRide(TimeDistance {
|
},
|
||||||
|
Record {
|
||||||
|
id: RecordId::default(),
|
||||||
|
data: TraxRecord::BikeRide(TimeDistance {
|
||||||
datetime: FixedOffset::west_opt(10 * 60 * 60)
|
datetime: FixedOffset::west_opt(10 * 60 * 60)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.with_ymd_and_hms(2019, 6, 15, 23, 0, 0)
|
.with_ymd_and_hms(2019, 6, 15, 23, 0, 0)
|
||||||
|
@ -211,6 +224,7 @@ mod test {
|
||||||
duration: Some(150. * S),
|
duration: Some(150. * S),
|
||||||
comments: Some("Test Comments".to_owned()),
|
comments: Some("Test Comments".to_owned()),
|
||||||
}),
|
}),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let groups = GroupedRecords::from(records).0;
|
let groups = GroupedRecords::from(records).0;
|
||||||
|
|
Loading…
Reference in New Issue