mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: include custom errors in test coverage
This commit is contained in:
parent
47e16ab48a
commit
f6a28aa226
1 changed files with 14 additions and 0 deletions
|
|
@ -94,3 +94,17 @@ impl ServiceError {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ServiceError;
|
||||
|
||||
#[test]
|
||||
fn test_service_error_code() {
|
||||
let error = ServiceError::CryptoHashFailed;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
|
||||
assert!(error.code() >= 100);
|
||||
assert!(error.code() <= 599);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue