use planr::prelude::*; /// Test the fmt::Display impl for a Class #[test] fn display_class(){ // Create class let mut class = Class { name: "class".to_string(), // Create task list tasks: TaskList { 0: Vec::new() } }; // Push assignment to class class.tasks.0.push(Task { name: "task 1".to_string(), due_date: 0, priority: 1, notes: "".to_string() }); // Push another assignment class.tasks.0.push(Task { name: "task 2".to_string(), due_date: 0, priority: 1, notes: "".to_string() }); let output = format!("{}", class); assert_eq!("Class: class\nAssignments:\ntask 1 | Due: 0 | Priority: 1\ntask 2 | Due: 0 | Priority: 1\n", output); } /// Test the fmt::Display impl for a Task #[test] fn display_task(){ let tsk = Task { name: "task".to_string(), due_date: 0, priority: 1, notes: "".to_string() }; let output = format!("{}", tsk); assert_eq!("task | Due: 0 | Priority: 1".to_string(), output); } // /// Test the fmt::Display impl for a Planner // #[test] // fn display_planner(){ // } // /// Test the fmt::Display impl for a ClassList // #[test] // fn display_classlist(){ // } // /// Test the fmt::Display impl for a TaskList // #[test] // fn display_tasklist(){ // }