Separate user configs from resident workload bounds
This commit is contained in:
@@ -164,8 +164,8 @@ mod tests {
|
||||
use rstest::{fixture, rstest};
|
||||
|
||||
use crate::{
|
||||
config::UserConfig, generator::backtracking, resident::Resident, schedule::MonthlySchedule,
|
||||
slot::Slot,
|
||||
bounds::WorkloadBounds, config::UserConfig, generator::backtracking, resident::Resident,
|
||||
schedule::MonthlySchedule, slot::Slot,
|
||||
};
|
||||
|
||||
#[fixture]
|
||||
@@ -175,23 +175,28 @@ mod tests {
|
||||
|
||||
#[fixture]
|
||||
fn config() -> UserConfig {
|
||||
let mut config = UserConfig::default().with_residents(vec![
|
||||
UserConfig::default().with_residents(vec![
|
||||
Resident::new("1", "Στέφανος"),
|
||||
Resident::new("2", "Ιορδάνης"),
|
||||
Resident::new("3", "Μαρία"),
|
||||
Resident::new("4", "Βεατρίκη"),
|
||||
Resident::new("5", "Τάκης"),
|
||||
Resident::new("6", "Μάκης"),
|
||||
]);
|
||||
config.calculate_workload_limits();
|
||||
config.calculate_holiday_limits();
|
||||
config.calculate_shift_type_fairness();
|
||||
config
|
||||
])
|
||||
}
|
||||
|
||||
#[fixture]
|
||||
fn bounds(config: UserConfig) -> WorkloadBounds {
|
||||
WorkloadBounds::new_with_config(&config)
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
pub fn test_export_as_doc(mut schedule: MonthlySchedule, config: UserConfig) {
|
||||
backtracking(&mut schedule, Slot::default(), &config);
|
||||
pub fn test_export_as_doc(
|
||||
mut schedule: MonthlySchedule,
|
||||
config: UserConfig,
|
||||
bounds: WorkloadBounds,
|
||||
) {
|
||||
backtracking(&mut schedule, Slot::default(), &config, &bounds);
|
||||
schedule.export_as_doc(&config);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user