diff --git a/epp-client/src/tests/de.rs b/epp-client/src/tests/de.rs index 6ba0ea8..7a6eb31 100644 --- a/epp-client/src/tests/de.rs +++ b/epp-client/src/tests/de.rs @@ -20,6 +20,7 @@ mod response { use crate::domain::transfer::DomainTransferReject; use crate::domain::transfer::DomainTransferRequest; use crate::domain::update::DomainUpdate; + use crate::extensions::namestore::NameStore; use crate::extensions::rgp::request::RgpRestoreRequest; use crate::hello::ExpiryType; use crate::hello::Greeting; @@ -645,4 +646,15 @@ mod response { assert_eq!(ext.data.rgp_status.status, "pendingRestore".to_string()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); } + + #[test] + fn namestore() { + let xml = get_xml("response/extensions/namestore.xml").unwrap(); + + let object = DomainCheck::::deserialize_response(xml.as_str()).unwrap(); + + let ext = object.extension.unwrap(); + + assert_eq!(ext.data.subproduct, "com".into()); + } } diff --git a/epp-client/src/tests/se.rs b/epp-client/src/tests/se.rs index f0b9cff..90963eb 100644 --- a/epp-client/src/tests/se.rs +++ b/epp-client/src/tests/se.rs @@ -29,6 +29,7 @@ mod request { use crate::domain::update::DomainAddRemove; use crate::domain::update::DomainChangeInfo; use crate::domain::update::DomainUpdate; + use crate::extensions::namestore::NameStore; use crate::extensions::rgp::report::RgpRestoreReport; use crate::extensions::rgp::request::RgpRestoreRequest; use crate::hello::Hello; @@ -582,4 +583,19 @@ mod request { assert_eq!(xml, serialized); } + + #[test] + fn namestore() { + let xml = get_xml("request/extensions/namestore.xml").unwrap(); + + let namestore_ext = NameStore::new("com"); + + let object = + DomainCheck::::new(vec!["example1.com", "example2.com", "example3.com"]) + .with_extension(namestore_ext); + + let serialized = object.serialize_request(CLTRID).unwrap(); + + assert_eq!(xml, serialized); + } } diff --git a/epp-client/test/resources/request/extensions/namestore.xml b/epp-client/test/resources/request/extensions/namestore.xml new file mode 100644 index 0000000..5a9a143 --- /dev/null +++ b/epp-client/test/resources/request/extensions/namestore.xml @@ -0,0 +1,18 @@ + + + + + + example1.com + example2.com + example3.com + + + + + com + + + cltrid:1626454866 + + \ No newline at end of file diff --git a/epp-client/test/resources/response/extensions/namestore.xml b/epp-client/test/resources/response/extensions/namestore.xml new file mode 100644 index 0000000..1b934f6 --- /dev/null +++ b/epp-client/test/resources/response/extensions/namestore.xml @@ -0,0 +1,27 @@ + + + + + Command completed successfully + + + + + eppdev.com + + + eppdev.net + + + + + + com + + + + cltrid:1626454866 + RO-6879-1627224678242975 + + + \ No newline at end of file