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(),
content: "test".to_string(),
description: "test".to_string(),
project_id: "test".to_string(),
section_id: None,
parent_id: None,
order: 1,
priority: 1,
is_completed: false,
labels: vec![],
created_at: "2024-01-01T00:00:00Z".to_string(),
due: None,
deadline: None,
duration: None,
assignee_id: None,
url: "https://todoist.com".to_string(),
comment_count: 0,
};
let _project: Project = Project {
id: "test".to_string(),
name: "test".to_string(),
comment_count: 0,
order: 1,
color: "blue".to_string(),
is_shared: false,
is_favorite: false,
is_inbox_project: false,
is_team_inbox: false,
view_style: "list".to_string(),
url: "https://todoist.com".to_string(),
parent_id: None,
};
let _label: Label = Label {
id: "test".to_string(),
name: "test".to_string(),
color: "red".to_string(),
order: 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()));
}
}