1pub mod models;
35pub mod wrapper;
36
37pub use models::*;
38pub use wrapper::TodoistWrapper;
39
40pub use anyhow::Result;
42
43#[cfg(test)]
44mod tests {
45 use super::*;
46
47 #[test]
48 fn test_todoist_wrapper_creation() {
49 let _wrapper = TodoistWrapper::new("test-token".to_string());
50 assert!(true); }
54
55 #[test]
56 fn test_library_exports() {
57 let _task: Task = Task {
59 id: "test".to_string(),
60 content: "test".to_string(),
61 description: "test".to_string(),
62 project_id: "test".to_string(),
63 section_id: None,
64 parent_id: None,
65 order: 1,
66 priority: 1,
67 is_completed: false,
68 labels: vec![],
69 created_at: "2024-01-01T00:00:00Z".to_string(),
70 due: None,
71 deadline: None,
72 duration: None,
73 assignee_id: None,
74 url: "https://todoist.com".to_string(),
75 comment_count: 0,
76 };
77
78 let _project: Project = Project {
79 id: "test".to_string(),
80 name: "test".to_string(),
81 comment_count: 0,
82 order: 1,
83 color: "blue".to_string(),
84 is_shared: false,
85 is_favorite: false,
86 is_inbox_project: false,
87 is_team_inbox: false,
88 view_style: "list".to_string(),
89 url: "https://todoist.com".to_string(),
90 parent_id: None,
91 };
92
93 let _label: Label = Label {
94 id: "test".to_string(),
95 name: "test".to_string(),
96 color: "red".to_string(),
97 order: 1,
98 is_favorite: false,
99 };
100
101 let _wrapper: TodoistWrapper = TodoistWrapper::new("test".to_string());
102
103 let _result: Result<()> = Ok(());
105 }
106
107 #[test]
108 fn test_argument_types() {
109 let task_args = CreateTaskArgs {
111 content: "Test task".to_string(),
112 priority: Some(3),
113 ..Default::default()
114 };
115
116 assert_eq!(task_args.content, "Test task");
117 assert_eq!(task_args.priority, Some(3));
118
119 let project_args = CreateProjectArgs {
120 name: "Test project".to_string(),
121 color: Some("blue".to_string()),
122 ..Default::default()
123 };
124
125 assert_eq!(project_args.name, "Test project");
126 assert_eq!(project_args.color, Some("blue".to_string()));
127 }
128}