use super::*;
/// Test assembling a complete file.
#[test]
fn relationships01() -> Result<()> {
let expected = "\
\n\
\
\
\
\
\
\
\
";
let mut relationships = Relationships::default();
relationships
.add_document_relationship("/worksheet", "worksheets/sheet1.xml");
relationships.add_document_relationship("/theme", "theme/theme1.xml");
relationships.add_document_relationship("/styles", "styles.xml");
relationships
.add_document_relationship("/sharedStrings", "sharedStrings.xml");
relationships.add_document_relationship("/calcChain", "calcChain.xml");
assert_eq!(
relationships.write_xml_document_to_string()?.as_str(),
expected
);
Ok(())
}
/// Test assembling a complete file.
#[test]
fn relationships02() -> Result<()> {
let expected = "\
\n\
\
\
\
\
";
let mut relationships = Relationships::default();
relationships.add_worksheet_relationship(
"/hyperlink",
"www.foo.com",
"External",
);
relationships.add_worksheet_relationship(
"/hyperlink",
"link00.xlsx",
"External",
);
assert_eq!(
relationships.write_xml_document_to_string()?.as_str(),
expected
);
Ok(())
}