feat: include custom errors in test coverage

This commit is contained in:
EETagent 2022-11-17 12:42:20 +01:00
parent 47e16ab48a
commit f6a28aa226

View file

@ -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);
}
}