diff --git a/core/src/error.rs b/core/src/error.rs index 4c8f4f1..206d579 100644 --- a/core/src/error.rs +++ b/core/src/error.rs @@ -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); + } +} \ No newline at end of file