From a6dfe703611a9d060c68d6aa455f9a9da6cb985f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 27 Jan 2022 11:57:19 +0100 Subject: [PATCH] Use bool for availability for contact/host resources as well --- src/contact/check.rs | 6 +++--- src/host/check.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/contact/check.rs b/src/contact/check.rs index 968bc0b..5ad94f7 100644 --- a/src/contact/check.rs +++ b/src/contact/check.rs @@ -55,7 +55,7 @@ pub struct ContactAvailable { pub id: StringValue<'static>, /// The avail attr on the <id> tag #[serde(rename = "avail")] - pub available: u16, + pub available: bool, } /// Type that represents the <cd> tag for contact check response @@ -117,12 +117,12 @@ mod tests { results.check_data.contact_list[0].contact.id, "eppdev-contact-1".into() ); - assert_eq!(results.check_data.contact_list[0].contact.available, 0); + assert!(!results.check_data.contact_list[0].contact.available); assert_eq!( results.check_data.contact_list[1].contact.id, "eppdev-contact-2".into() ); - assert_eq!(results.check_data.contact_list[1].contact.available, 1); + assert!(results.check_data.contact_list[1].contact.available); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); } diff --git a/src/host/check.rs b/src/host/check.rs index aed72e8..0f511c3 100644 --- a/src/host/check.rs +++ b/src/host/check.rs @@ -58,7 +58,7 @@ pub struct HostAvailable { pub name: StringValue<'static>, /// The host (un)availability #[serde(rename = "avail")] - pub available: u16, + pub available: bool, } /// Type that represents the <cd> tag for host check response @@ -122,12 +122,12 @@ mod tests { result.check_data.host_list[0].host.name, "host1.eppdev-1.com".into() ); - assert_eq!(result.check_data.host_list[0].host.available, 1); + assert!(result.check_data.host_list[0].host.available); assert_eq!( result.check_data.host_list[1].host.name, "ns1.testing.com".into() ); - assert_eq!(result.check_data.host_list[1].host.available, 0); + assert!(!result.check_data.host_list[1].host.available); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); }