mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-18 15:20:15 +01:00
Add ParseMode
serialization tests
This commit is contained in:
parent
4d241131fc
commit
d08b418d59
1 changed files with 22 additions and 0 deletions
|
@ -68,3 +68,25 @@ pub enum ParseMode {
|
||||||
HTML,
|
HTML,
|
||||||
Markdown,
|
Markdown,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn html_serialization() {
|
||||||
|
let expected_json = String::from(r#""HTML""#);
|
||||||
|
let actual_json = serde_json::to_string(&ParseMode::HTML).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(expected_json, actual_json)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn markdown_serialization() {
|
||||||
|
let expected_json = String::from(r#""Markdown""#);
|
||||||
|
let actual_json = serde_json::to_string(&ParseMode::Markdown).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(expected_json, actual_json)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue