mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
Fix the tests
This commit is contained in:
parent
d165de64d7
commit
a801953516
2 changed files with 4 additions and 4 deletions
|
@ -107,8 +107,8 @@ impl Update {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
Chat, ChatKind, ForwardKind, LanguageCode, MediaKind, Message,
|
Chat, ChatKind, ForwardKind, MediaKind, Message, MessageKind, Update,
|
||||||
MessageKind, Update, UpdateKind, User,
|
UpdateKind, User,
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: more tests for deserialization
|
// TODO: more tests for deserialization
|
||||||
|
@ -158,7 +158,7 @@ mod test {
|
||||||
first_name: String::from("Waffle"),
|
first_name: String::from("Waffle"),
|
||||||
last_name: None,
|
last_name: None,
|
||||||
username: Some(String::from("WaffleLapkin")),
|
username: Some(String::from("WaffleLapkin")),
|
||||||
language_code: Some(LanguageCode::EN),
|
language_code: Some(String::from("en")),
|
||||||
}),
|
}),
|
||||||
forward_kind: ForwardKind::Origin {
|
forward_kind: ForwardKind::Origin {
|
||||||
reply_to_message: None,
|
reply_to_message: None,
|
||||||
|
|
|
@ -85,7 +85,7 @@ mod tests {
|
||||||
first_name: "firstName".to_string(),
|
first_name: "firstName".to_string(),
|
||||||
last_name: Some("lastName".to_string()),
|
last_name: Some("lastName".to_string()),
|
||||||
username: Some("Username".to_string()),
|
username: Some("Username".to_string()),
|
||||||
language_code: Some(LanguageCode::RU),
|
language_code: Some(String::from("ru")),
|
||||||
};
|
};
|
||||||
let actual = serde_json::from_str::<User>(&json).unwrap();
|
let actual = serde_json::from_str::<User>(&json).unwrap();
|
||||||
assert_eq!(actual, expected)
|
assert_eq!(actual, expected)
|
||||||
|
|
Loading…
Add table
Reference in a new issue