Use bool for availability for contact/host resources as well
This commit is contained in:
parent
0c36d8add3
commit
a6dfe70361
|
@ -55,7 +55,7 @@ pub struct ContactAvailable {
|
||||||
pub id: StringValue<'static>,
|
pub id: StringValue<'static>,
|
||||||
/// The avail attr on the <id> tag
|
/// The avail attr on the <id> tag
|
||||||
#[serde(rename = "avail")]
|
#[serde(rename = "avail")]
|
||||||
pub available: u16,
|
pub available: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type that represents the <cd> tag for contact check response
|
/// Type that represents the <cd> tag for contact check response
|
||||||
|
@ -117,12 +117,12 @@ mod tests {
|
||||||
results.check_data.contact_list[0].contact.id,
|
results.check_data.contact_list[0].contact.id,
|
||||||
"eppdev-contact-1".into()
|
"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!(
|
assert_eq!(
|
||||||
results.check_data.contact_list[1].contact.id,
|
results.check_data.contact_list[1].contact.id,
|
||||||
"eppdev-contact-2".into()
|
"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.client_tr_id.unwrap(), CLTRID.into());
|
||||||
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub struct HostAvailable {
|
||||||
pub name: StringValue<'static>,
|
pub name: StringValue<'static>,
|
||||||
/// The host (un)availability
|
/// The host (un)availability
|
||||||
#[serde(rename = "avail")]
|
#[serde(rename = "avail")]
|
||||||
pub available: u16,
|
pub available: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type that represents the <cd> tag for host check response
|
/// Type that represents the <cd> tag for host check response
|
||||||
|
@ -122,12 +122,12 @@ mod tests {
|
||||||
result.check_data.host_list[0].host.name,
|
result.check_data.host_list[0].host.name,
|
||||||
"host1.eppdev-1.com".into()
|
"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!(
|
assert_eq!(
|
||||||
result.check_data.host_list[1].host.name,
|
result.check_data.host_list[1].host.name,
|
||||||
"ns1.testing.com".into()
|
"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.client_tr_id.unwrap(), CLTRID.into());
|
||||||
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue