-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathcontact_folder_path.rs
100 lines (86 loc) · 2.08 KB
/
contact_folder_path.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#[macro_use]
extern crate lazy_static;
use graph_rs_sdk::*;
use test_tools::common::TestTools;
lazy_static! {
static ref ID_VEC: Vec<String> = TestTools::random_strings(4, 20);
}
#[test]
fn get_contact_folder() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/me/contactFolders/{}", ID_VEC[0].as_str()),
client
.me()
.contact_folder(ID_VEC[0].as_str())
.get_contact_folders()
.url()
.path()
);
}
#[test]
fn contact_folder_delta() {
let client = Graph::new("");
assert_eq!(
"/v1.0/me/contactFolders/delta()".to_string(),
client.me().contact_folders().delta().url().path()
);
}
#[test]
fn update_contact_folder() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/me/contactFolders/{}", ID_VEC[0].as_str()),
client
.me()
.contact_folder(ID_VEC[0].as_str())
.update_contact_folders(&String::new())
.url()
.path()
);
}
#[test]
fn list_child_folders() {
let client = Graph::new("");
assert_eq!(
format!(
"/v1.0/me/contactFolders/{}/childFolders",
ID_VEC[0].as_str()
),
client
.me()
.contact_folder(ID_VEC[0].as_str())
.child_folders()
.list_child_folders()
.url()
.path()
);
}
#[test]
fn list_contacts() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/me/contactFolders/{}/contacts", ID_VEC[0].as_str()),
client
.me()
.contact_folder(ID_VEC[0].as_str())
.contacts()
.list_contacts()
.url()
.path()
);
}
#[test]
fn create_contacts() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/me/contactFolders/{}/contacts", ID_VEC[0].as_str()),
client
.me()
.contact_folder(ID_VEC[0].as_str())
.contacts()
.create_contacts(&String::new())
.url()
.path()
);
}