+ #[test]
+ fn builds_offer_with_description() {
+ let offer = OfferBuilder::new(pubkey(42))
+ .description("foo".into())
+ .build()
+ .unwrap();
+ assert_eq!(offer.description(), Some(PrintableString("foo")));
+ assert_eq!(offer.as_tlv_stream().description, Some(&String::from("foo")));
+
+ let offer = OfferBuilder::new(pubkey(42))
+ .description("foo".into())
+ .description("bar".into())
+ .build()
+ .unwrap();
+ assert_eq!(offer.description(), Some(PrintableString("bar")));
+ assert_eq!(offer.as_tlv_stream().description, Some(&String::from("bar")));
+
+ let offer = OfferBuilder::new(pubkey(42))
+ .amount_msats(1000)
+ .build()
+ .unwrap();
+ assert_eq!(offer.description(), Some(PrintableString("")));
+ assert_eq!(offer.as_tlv_stream().description, Some(&String::from("")));
+ }
+