pub mod models;
pub mod wrapper;
pub use models::*;
pub use wrapper::TodoistWrapper;
pub use models::{TodoistError, TodoistResult};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_todoist_wrapper_creation() {
let _wrapper = TodoistWrapper::new("test-token".to_string());
}
#[test]
fn test_library_exports() {
let _task: Task = Task {
id: "test".to_string(),
user_id: "user123".to_string(),
content: "test".to_string(),
description: "test".to_string(),
project_id: "test".to_string(),
section_id: None,
parent_id: None,
added_by_uid: None,
assigned_by_uid: None,
responsible_uid: None,
labels: vec![],
deadline: None,
duration: None,
checked: false,
is_deleted: false,
added_at: "2024-01-01T00:00:00Z".to_string(),
completed_at: None,
completed_by_uid: None,
updated_at: None,
due: None,
priority: 1,
child_order: 0,
note_count: 0,
day_order: 0,
is_collapsed: false,
};
let _project: Project = Project {
id: "test".to_string(),
name: "test".to_string(),
color: "blue".to_string(),
is_shared: false,
is_favorite: false,
inbox_project: false,
view_style: "list".to_string(),
parent_id: None,
child_order: 0,
creator_uid: None,
created_at: None,
updated_at: None,
is_archived: false,
is_deleted: false,
is_frozen: false,
is_collapsed: false,
can_assign_tasks: false,
default_order: 0,
description: String::new(),
public_key: String::new(),
role: None,
};
let _label: Label = Label {
id: "test".to_string(),
name: "test".to_string(),
color: "red".to_string(),
order: Some(1),
is_favorite: false,
};
let _wrapper: TodoistWrapper = TodoistWrapper::new("test".to_string());
let _result: TodoistResult<()> = Ok(());
}
#[test]
fn test_argument_types() {
let task_args = CreateTaskArgs {
content: "Test task".to_string(),
priority: Some(3),
..Default::default()
};
assert_eq!(task_args.content, "Test task");
assert_eq!(task_args.priority, Some(3));
let project_args = CreateProjectArgs {
name: "Test project".to_string(),
color: Some("blue".to_string()),
..Default::default()
};
assert_eq!(project_args.name, "Test project");
assert_eq!(project_args.color, Some("blue".to_string()));
}
}