-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathteams_url.rs
96 lines (84 loc) · 2.26 KB
/
teams_url.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
use graph_rs_sdk::*;
static RID: &str = "T5Y6RODPNfYICbtYWrofwUGBJWnaJkNwH9x";
static ID: &str = "b!CbtYWrofwUGBJWnaJkNwoNrBLp_kC3RKklSXPwrdeP3yH8_qmH9xT5Y6RODPNfYI";
#[test]
fn get_teams_request() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/teams/{RID}"),
client.teams().id(RID).get_team().url().path()
);
assert_eq!(
format!("/v1.0/teams/{RID}"),
client.team(RID).get_team().url().path()
);
}
#[test]
fn teams_channel_request() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/teams/{RID}/channels"),
client.team(RID).channels().list_channels().url().path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/channels/{ID}"),
client.team(RID).channel(ID).get_channels().url().path()
);
}
#[test]
fn teams_primary_channel_request() {
let client = Graph::new("");
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel"),
client
.team(RID)
.primary_channel()
.get_primary_channel()
.url()
.path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel/tabs/{ID}"),
client.team(RID).primary_channel().get_tabs(ID).url().path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel/sharedWithTeams/{ID}"),
client
.team(RID)
.primary_channel()
.shared_with_team(ID)
.get_shared_with_teams()
.url()
.path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel/sharedWithTeams"),
client
.team(RID)
.primary_channel()
.shared_with_teams()
.list_shared_with_teams()
.url()
.path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel/messages"),
client
.team(RID)
.primary_channel()
.messages()
.list_messages()
.url()
.path()
);
assert_eq!(
format!("/v1.0/teams/{RID}/primaryChannel/messages/{ID}"),
client
.team(RID)
.primary_channel()
.message(ID)
.get_messages()
.url()
.path()
);
}