diff options
| author | Kevin J Hoerr <kjhoerr@submelon.tech> | 2019-10-30 09:40:39 -0400 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@submelon.tech> | 2019-10-30 09:40:39 -0400 |
| commit | b3a313f8e5e0185104727e75747251121eddf92d (patch) | |
| tree | 7619d8d14d99767803658e62c21792136d7a1ada /src/routes/messages/not_understood.rs | |
| parent | 067e9784b54e4645412e5e7d8d7d2bc70bdcf646 (diff) | |
| download | august-offensive-b3a313f8e5e0185104727e75747251121eddf92d.tar.gz august-offensive-b3a313f8e5e0185104727e75747251121eddf92d.tar.bz2 august-offensive-b3a313f8e5e0185104727e75747251121eddf92d.zip | |
Refactor messages module to be separate from routes and easily referencable
Diffstat (limited to 'src/routes/messages/not_understood.rs')
| -rw-r--r-- | src/routes/messages/not_understood.rs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/routes/messages/not_understood.rs b/src/routes/messages/not_understood.rs deleted file mode 100644 index 6c2c3ae..0000000 --- a/src/routes/messages/not_understood.rs +++ /dev/null @@ -1,48 +0,0 @@ -use messages::Message; - -#[derive(Debug, Serialize)] -pub struct NotUnderstood { - pub path: Vec<String>, -} - -impl Message for NotUnderstood { - fn name(&self) -> String { - String::from("NOT_UNDERSTOOD") - } -} - -impl PartialEq for NotUnderstood { - fn eq(&self, other: &Self) -> bool { - self.path == other.path - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_name() { - // Arrange - let message = NotUnderstood { path: vec![] }; - - // Act - let name = message.name(); - - // Assert - assert_eq!(name, "NOT_UNDERSTOOD"); - } - - #[test] - fn test_asoutgoing() { - // Arrange - let message = NotUnderstood { path: vec![] }; - - // Act - let outgoing = message.as_outgoing(); - - // Assert - assert_eq!(outgoing.result_type, "NOT_UNDERSTOOD"); - assert_eq!(outgoing.content, NotUnderstood { path: vec![] }); - } -} |
