Equal(GroupIban(other),std::string(other),"what is no IBAN is left as it is");
}
Equal(AccountKey(Account{.name="Main",.bic="BUNQNL2A",.iban=std::string(iban),.currency=euro,.balance=0}),std::string(iban),"an account is found by its IBAN");
Equal(AccountKey(Account{.name="Pocket",.bic="",.iban="",.currency=euro,.balance=0}),std::string("Pocket"),"or by its name where it has none");
Equal(PartyName(BunqLabel{.name="Bob",.iban=std::string(iban)}),std::string("Bob"),"someone is said by name");
Equal(PartyName(BunqLabel{.name="",.iban=std::string(iban)}),std::string("NL91 ABNA 0417 1643 00"),"else by IBAN");
Equal(PartyName(BunqLabel{.name="",.iban=""}),std::string("Unknown"),"and as unknown where the bank says neither");
Equal(PartyName(BunqCounterparty{.type="IBAN",.value=std::string(iban),.name="Bob"}),std::string("Bob"),"a payee by the name given");
Equal(PartyName(BunqCounterparty{.type="EMAIL",.value="bob@example.org",.name=""}),std::string("bob@example.org"),"else by the address");
Check(LocalDay(ParseLocalDate("2026-11-19 00:00"))==LocalDay(ParseLocalDate("2026-11-19 23:59"))&&LocalDay(ParseLocalDate("2026-11-19 23:59"))!=LocalDay(ParseLocalDate("2026-11-20 00:00")),"a day runs from midnight to midnight");
Equal(DayLabel(ParseLocalDate("2026-11-03 12:00"),now),std::string("Tuesday 3 November"),"a day of this year by its name");
Equal(DayLabel(ParseLocalDate("2025-12-31 12:00"),now),std::string("Wednesday 31 December 2025"),"one of another year with it");
// The night the clocks go back: the day before is 25 hours long.
Equal(DayLabel(ParseLocalDate("2026-10-24 23:30"),ParseLocalDate("2026-10-25 00:30")),std::string("Yesterday"),"yesterday across a change of the clocks");
Equal(DayLabel(ParseLocalDate("2026-10-25 01:30"),ParseLocalDate("2026-10-26 00:10")),std::string("Yesterday"),"and after it");
Equal(ShortDate(ParseLocalDate("2026-11-03"),now),std::string("3 Nov"),"a short date");
Equal(ShortDate(ParseLocalDate("2025-12-31"),now),std::string("31 Dec 2025"),"with its year when that is another");
Equal(ClockTime(ParseLocalDate("2026-11-03 14:05")),std::string("14:05"),"the time of day");
Equal(FullTime(ParseLocalDate("2026-11-03 14:05")),std::string("3 November 2026, 14:05"),"a moment in full");
Equal(DateInput(ParseLocalDate("2026-11-03 14:05")),std::string("2026-11-03"),"a day as a field takes it");
Equal(Fingerprint("short"),std::string("5 characters"),"a short secret shows nothing of itself but how long it is");
Equal(Fingerprint("x"),std::string("1 character"),"one character is one");
Equal(Fingerprint("sandbox_ab12cd34ef56gh78"),std::string("sandbox_ab12… 24 characters"),"a key shows what it is for, how it goes on and how long it is");
Equal(Fingerprint("sandbox_ab12cd34ef56gh7"),std::string("23 characters"),"one that would show most of itself that way shows nothing of itself");
Equal(Fingerprint("abcdefghijklmnopqrst"),std::string("abcd… 20 characters"),"one without a mark its first four");
Equal(Fingerprint("abcdefghijklmn_opqrst"),std::string("abcd… 21 characters"),"and so one whose mark comes late");
Equal(Fingerprint("ééééééééééééééééé"),std::string("éééé… 17 characters"),"by characters, not by bytes");
// How a key ends is what was typed last: shown, a key typed by hand would be shown whole, a character at a
// time. So typing on changes nothing of what is shown but the count.
std::stringtyped="sandbox_ab12cd34ef56gh78";
for(constcharnext:std::string_view("WXYZ")){
typed+=next;
Equal(Fingerprint(typed),std::format("sandbox_ab12… {} characters",typed.size()),"what is typed after the beginning is never shown");
{"","An IBAN, an e-mail address or a phone number"},{"NL91ABNA0417164301","Not a valid IBAN"},{"Bob","Not a valid IBAN"},
{"@example.org","Not an e-mail address"},{"bob@","Not an e-mail address"},{"bob smith@example.org","Not an e-mail address"},{"+31x","Not a phone number"},
}}){
constRead<BunqCounterparty>read=ReadParty(text);
Check(!read.value&&read.error.contains(why),std::format("'{}' is refused: {}",text,why));
}
Check(ReadDay(" 2026-11-03 ").value==ParseLocalDate("2026-11-03"),"a day is its start");
Check(ReadDay("2026-11-03","14:05").value==ParseLocalDate("2026-11-03 14:05"),"or the time on it");
Check(ReadDay("2026-11-03",{},true).value==ParseLocalDateEnd("2026-11-03"),"or its last moment, for the end of a range");
Check(ReadDay("2026-11-03"," 14:05 ",true).value==ParseLocalDate("2026-11-03 14:05"),"a time given is that time either way");
{"","","A day: YYYY-MM-DD"},{"2026-13-01","","Not a day"},{"tomorrow","","Not a day"},{"2026-13-01","10:00","Not a day"},{"2026-11-03","25:00","Not a time: hh:mm"},
}}){
constRead<Moment>read=ReadDay(day,time);
Check(!read.value&&read.error.contains(why),std::format("'{}' '{}' is refused: {}",day,time,why));
Check(errors.Any()&&!errors.to.empty()&&!errors.amount.empty()&&errors.name.empty(),"an empty form lacks who and how much");
Check(!PaymentForm::Errors().Any(),"no errors is none");
form.to.Set("NL91 ABNA 0417 1643 00");
form.amount.Set("12,50");
form.description.Set(" lunch ");
errors=form.Check(euro,now,order);
Check(errors.Any()&&errors.to.empty()&&errors.amount.empty()&&errors.name=="The name of the account's holder","an IBAN needs its holder's name");
Equal(order.amount,std::int64_t{0},"and a form with an error gives no order");
form.name.Set(" Bob ");
errors=form.Check(euro,now,order);
Check(!errors.Any()&&order.to.type=="IBAN"&&order.to.value==iban&&order.to.name=="Bob"&&order.amount==1250&&order.description=="lunch"&&order.when==When::Now,"a form filled in is an order");
form.to.Set("bob@example.org");
form.name.Clear();
errors=form.Check(euro,now,order);
Check(!errors.Any()&&order.to.type=="EMAIL"&&order.to.name.empty(),"an e-mail address needs no name");
// A schedule: a first day, an optional time, and for one that repeats how often and until when.
form.when=When::Scheduled;
errors=form.Check(euro,now,order);
Equal(errors.day,std::string("A day: YYYY-MM-DD"),"a schedule needs its first day");
form.day.Set("soon");
Equal(form.Check(euro,now,order).day,std::string("Not a day: YYYY-MM-DD"),"which is a day");
form.day.Set("2026-11-18");
Equal(form.Check(euro,now,order).day,std::string("Today or later"),"not one that has passed");
form.day.Set("2026-11-19");
Check(!form.Check(euro,now,order).Any()&&order.when==When::Scheduled&&order.schedule.unit=="ONCE"&&order.schedule.start==ParseLocalDate("2026-11-19"),"today will do, once, from the start of the day");
form.time.Set("25:00");
Equal(form.Check(euro,now,order).time,std::string("Not a time: hh:mm"),"its time is one");
form.day.Set("2026-11-20");
form.time.Set("09:30");
// Once has nothing to repeat: what is left in those fields is not looked at.
form.every.Set("0");
form.until.Set("never");
Check(!form.Check(euro,now,order).Any()&&order.schedule.start==ParseLocalDate("2026-11-20 09:30")&&order.schedule.every==1&&!order.schedule.end,"a time on the day, once");
form.unit=3;
errors=form.Check(euro,now,order);
Check(errors.every=="A whole number, 1 or more"&&errors.until=="Not a day: YYYY-MM-DD","one that repeats checks how often and until when");
form.every.Set("2");
form.until.Set("2026-11-19");
Equal(form.Check(euro,now,order).until,std::string("After the first payment"),"it ends after it starts");
form.until.Set("2027-01-01");
Check(!form.Check(euro,now,order).Any()&&order.schedule.unit=="WEEKLY"&&order.schedule.every==2&&order.schedule.end==ParseLocalDateEnd("2027-01-01"),"every other week until the end of a day");
form.every.Clear();
form.until.Clear();
Check(!form.Check(euro,now,order).Any()&&order.schedule.every==1&&!order.schedule.end,"or every week, for as long as it runs");
form.day.Set("nonsense");
form.until.Set("2027-01-01");
Check(form.Check(euro,now,order).until.empty(),"an end is not held against a start that is not there");
form.when=When::Draft;
form.day.Clear();
Check(!form.Check(euro,now,order).Any()&&order.when==When::Draft,"a draft needs no day");
form.tried=true;
form.Clear();
Check(form.to.value.empty()&&form.amount.value.empty()&&form.when==When::Now&&form.unit==0&&form.day.value.empty()&&!form.tried,"a cleared form is as new");
{to,"",std::nullopt,"","an IBAN alone: how much and what for are the user's to say"},
{"PAYTO://IBAN/nl91abna0417164300","",std::nullopt,"","the scheme in capitals and the IBAN in small letters"},
{std::format("payto://iban/ABNANL2A/{}",iban),"",std::nullopt,"","a bank's code of eight before the IBAN, which is left out"},
{std::format("payto://iban/ABNANL2AXXX/{}",iban),"",std::nullopt,"","or one of eleven"},
{with(""),"",std::nullopt,"","a question mark with nothing after it"},
{with("amount=EUR:12.50&receiver-name=Shop%20BV&message=Order%201234"),"Shop BV",1250,"Order 1234","who, how much and what for"},
{with("amount=EUR%3A12.5"),"",1250,"","the amount's colon as an escape, as a browser's own writer of queries has it"},
{with("amount=eur:12"),"",1200,"","the currency in small letters, and no cents"},
{with("amount=EUR:0012.50"),"",1250,"","zeros before it"},
{with("amount=EUR:999999999999.99"),"",99999999999999,"","the most a form takes"},
{with("message=a+b%2Bc"),"",std::nullopt,"a b+c","a plus for a space, and an escaped one for a plus"},
{with("receiver-name=%20Bob%20"),"Bob",std::nullopt,"","spaces around a name are not part of it"},
{with("message"),"",std::nullopt,"","an option without a value says nothing"},
{with("AMOUNT=EUR:1&%6Dessage=x&Receiver-Name=Bob"),"Bob",100,"x","an option's name in capitals or as escapes is that option"},
{with("utm_source=mail&sender-name=Eve&flag&=x&&amount=EUR:5&"),"",500,"","what Nostro does not know is passed over, wherever it stands"},
{with("message=caf%C3%A9%20%E2%82%AC%20%F0%9F%98%80"),"",std::nullopt,"café € 😀","characters of two, three and four bytes, as escapes"},
{with("receiver-name=Café René"),"Café René",std::nullopt,"","or as they are"},
{with("receiver-name=Fish%20%26%20Chips%20%3CNL%3E&message=5%20%24(each)"),"Fish & Chips <NL>",std::nullopt,"5 $(each)","an &, a <, a > and a $( are a name's and a description's to have: only the system's dialog shows a name otherwise"},
{std::format("{}?receiver-name={}&message={}",to,times("a",70),times("b",140)),times("a",70),std::nullopt,times("b",140),"a name of 70 characters and a description of 140"},
{std::format("{}?receiver-name={}&message={}",to,times("%C3%A9",70),times("%E2%82%AC",140)),times("é",70),std::nullopt,times("€",140),"counted in characters, not in bytes"},
Check(link.value&&link.error.empty()&&link.value->iban==iban&&link.value->name==asked.name&&link.value->amount==asked.amount&&link.value->currency==euro&&link.value->description==asked.description,std::format("a link is read: {}",asked.what));
// What is read is what the form then holds, to the letter, and what its order asks nostrod for.
PaymentFormform;
form.Fill(link.value.value_or(PaymentLink()));
Check(form.linked&&form.to.value==iban&&form.name.value==asked.name&&form.description.value==asked.description&&ReadAmount(form.amount.value,euro).value==asked.amount,std::format("and fills the form in with just that: {}",asked.what));
}
constexprstd::string_viewnotOne="It is not a link to pay an IBAN";
constexprstd::string_viewnoIban="The IBAN in it is not a valid one";
constexprstd::string_viewdamaged="something in it is there twice, or cannot be read";
constexprstd::string_viewinstruction="a reference of a kind Nostro cannot send along";
constexprstd::string_viewnoAmount="The amount in it cannot be read";
constexprstd::string_viewnoCurrency="a currency Nostro does not pay in";
constexprstd::string_viewnotPlain="holds what a payment cannot carry";
{with("instruction"),instruction,"one without a value"},
{with("INSTRUCTION=MARK"),instruction,"one in capitals"},
{with("amount=12.50"),noAmount,"an amount without its currency"},
{with("amount=EUR"),noAmount,"a currency without an amount"},
{with("amount=EUR:"),noAmount,"a currency and a colon"},
{with("amount="),noAmount,"an empty amount"},
{with("amount"),noAmount,"an amount without a value"},
{with("amount=EUR:12,50"),noAmount,"a comma for the point: twelve hundred and fifty by the letter of RFC 8905, twelve and a half to whoever wrote it"},
{with("amount=EUR:1,250.00"),noAmount,"a comma between the thousands"},
{with("amount=EUR:-1"),noAmount,"less than nothing"},
{with("amount=EUR:+1"),noAmount,"a plus, which reads as a space"},
{with("amount=EUR:%201"),noAmount,"a space"},
{with("amount=EUR:12."),noAmount,"a point with nothing after it"},
{with("amount=EUR:.5"),noAmount,"a point with nothing before it"},
{with("amount=EUR:1.2.3"),noAmount,"two points"},
{with("amount=EUR:1e3"),noAmount,"a power of ten"},
{with("amount=EUR:%D9%A1%D9%A2"),noAmount,"digits of another script"},
{with("amount=EUR:1.234"),noAmount,"more decimals than the euro has"},
{with("amount=EUR:0"),noAmount,"nothing"},
{with("amount=EUR:0.00"),noAmount,"nothing, to the cent"},
{with("amount=EUR:1234567890123"),noAmount,"more than a form takes"},
{with("message=%EF%BB%BFMARK"),notPlain,"a byte order mark"},
{with("message=%EE%80%80MARK"),notPlain,"a character of private use"},
{with("message=M%C1%81RK"),notPlain,"an A written in two bytes, which reads as one and is none"},
{with("message=%E0%80%AFMARK"),notPlain,"a slash written in three"},
{with("message=%F0%80%80%AFMARK"),notPlain,"and in four"},
{with("message=%ED%A0%80MARK"),notPlain,"half of a pair"},
{with("message=%F4%90%80%80MARK"),notPlain,"a character beyond the last there is"},
{with("message=MARK%F0%9F%BF%BE"),notPlain,"the last but one of the second plane, which is no character and which the bus refuses"},
{with("receiver-name=MARK%F3%AF%BF%BF"),notPlain,"and the last of the fifteenth"},
{with("message=%F8%88%80%80%80MARK"),notPlain,"five bytes, which begin no character"},
{with("message=MARK%C3"),notPlain,"a character cut short"},
{with("message=%FFMARK"),notPlain,"a byte that is in no character"},
{with("message=MARK%EF%BF%BD"),notPlain,"the mark that stands for what could not be read"},
{std::format("{}?receiver-name={}",to,times("a",71)),tooLong,"a name of 71 characters"},
{std::format("{}?message={}",to,times("%C3%A9",141)),tooLong,"a description of 141"},
};
for(constauto&[link,why,what]:refused){
constRead<PaymentLink>none=ReadPaymentLink(link);
Check(!none.value&&none.error.contains(why),std::format("a link is refused for {}: {}",what,why));
// Why it was refused is said in the app's own words: nothing of a stranger's link comes back in them.
Check(!none.error.contains("MARK")&&!none.error.contains("NL91")&&!none.error.contains("payto"),std::format("and what says so holds nothing of the link: {}",what));
}
// The form a link fills in: all of it the link's, in place of whatever was there, and none of it sent.
Check(!form.Check(euro,now,order).Any()&&order.to.type=="IBAN"&&order.to.value==iban&&order.to.name=="Shop BV"&&order.amount==1250&&order.description=="Order 1234"&&order.when==When::Now,"a link's form asks for what the link said, now");
Check(form.linked&&!form.tried&&form.day.value.empty()&&form.unit==0&&form.every.value.empty(),"with nothing left of what the form held before, and marked as a link's");
Check(form.linked&&form.amount.value.empty()&&form.name.value.empty()&&errors.amount=="Enter an amount"&&errors.name=="The name of the account's holder","a link that says no more than who is paid leaves the rest to the user");
form.Clear();
Check(!form.linked&&form.to.value.empty(),"a cleared form is nobody's");
Check(errors.Any()&&!errors.from.empty()&&!errors.amount.empty()&&errors.name.empty()&&!RequestForm::Errors().Any(),"an empty request lacks who and how much");
form.from.Set(iban);
form.amount.Set("5");
Equal(form.Check(euro,order).name,std::string("The name of the account's holder"),"an IBAN needs its holder's name");
form.name.Set("Bob");
form.description.Set("back");
Check(!form.Check(euro,order).Any()&&order.from.value==iban&&order.from.name=="Bob"&&order.amount==500&&order.description=="back","a request filled in is an order");
form.from.Set("+31612345678");
form.name.Clear();
Check(!form.Check(euro,order).Any()&&order.from.type=="PHONE_NUMBER","a phone number needs no name");
form.tried=true;
form.Clear();
Check(form.from.value.empty()&&form.amount.value.empty()&&form.description.value.empty()&&!form.tried,"a cleared request is as new");
Check(!form.Check(euro,query).Any()&&query.search.empty()&&!query.amount&&query.from==Moment::min()&&query.to==Moment::max()&&query.limit==300,"an empty filter asks for everything, as many as before");
Check(!form.Check(euro,query).Any()&&query.search=="rent"&&query.amount==-1250&&query.from==ParseLocalDate("2026-11-01")&&query.to==ParseLocalDateEnd("2026-11-30"),"what went out, between two days, the last one whole");
Check(form.Chips(euro,now)==std::vector<std::string>{"Paid €12.50","From 1 Nov","Until 30 Nov"},"said in a few words each");
form.received=true;
Check(!form.Check(euro,query).Any()&&query.amount==1250&&form.Chips(euro,now).front()=="Received €12.50","or what came in");
Check(errors.Any()&&errors.amount.contains("At most 2 decimals")&&errors.from.contains("Not a day")&&errors.to.contains("Not a day")&&query.search.empty(),"a filter with a mistake asks for nothing");
Check(form.Chips(euro,now).empty(),"and what cannot be read is no chip");
form.amount.Clear();
form.from.Set("2026-11-30");
form.to.Set("2026-11-01");
Equal(form.Check(euro,query).to,std::string("On or after the first day"),"a range ends after it starts");
form.to.Set("2026-11-30");
Check(!form.Check(euro,query).Any(),"one day is a range");
form.Reset();
Check(form.amount.value.empty()&&form.from.value.empty()&&form.to.value.empty()&&!form.received&&form.search.value==" rent ","a reset keeps the search and drops the rest");
}
voidConnecting(){
BunqKeyFormkey;
Check(key.ips.value=="*"&&key.Check()=="The API key, from the bunq app","a new key form allows any address and lacks its key");
key.key.Set("sandbox_0123456789abcdef");
key.ips.Set("10.0.0.1");
key.advanced=true;
key.tried=true;
Check(key.Check().empty(),"with a key it can be sent");
key.Clear();
Check(key.key.value.empty()&&key.ips.value=="*"&&!key.advanced&&!key.tried,"a cleared key form is as new");
BunqOAuthFormoauth;
BunqOAuthForm::Errorserrors=oauth.Check();
Check(errors.Any()&&!errors.clientId.empty()&&!errors.redirectUri.empty()&&!errors.secret.empty()&&!BunqOAuthForm::Errors().Any(),"an empty OAuth form lacks everything");
oauth.clientId.Set(" client-1 ");
oauth.secret.Set("secret-1");
oauth.redirectUri.Set("ftp://example.org/cb");
Check(!oauth.Check().redirectUri.empty()&&oauth.Check().clientId.empty()&&oauth.Check().secret.empty(),"a redirect address is a web address");
oauth.redirectUri.Set("http://127.0.0.1/cb");
Check(!oauth.Check().Any(),"to this computer itself will do");
Equal(oauth.address,std::string("https://oauth.bunq.com/auth?response_type=code&client_id=client-1&redirect_uri=https%3A%2F%2Fexample.org%2Fcb&state=state123"),"the address to approve at, with this request's state");
oauth.sandbox=true;
oauth.Begin("state456");
Check(oauth.address.starts_with("https://oauth.sandbox.bunq.com/auth?")&&oauth.state=="state456","the sandbox has its own");
Throws<std::runtime_error>([&oauth]{oauth.Code();},"bunq did not authorize","and so is bunq's refusal");
oauth.tried=true;
oauth.Clear();
Check(oauth.clientId.value.empty()&&oauth.redirectUri.value.empty()&&oauth.secret.value.empty()&&!oauth.sandbox&&oauth.redirected.value.empty()&&oauth.state.empty()&&oauth.address.empty()&&!oauth.tried,"a cleared OAuth form is as new");
Check(ActionOf(operation)==action&&MovesMoney(operation)==money&&(ActionOf(operation)==Bus::actionView)==(operation==Operation::Load),std::format("operation {} asks for {}",std::to_underlying(operation),action));
Check(told.problem==Problem::NoService&&told.retry&&!told.mayHaveHappened&&told.detail.contains("README")&&told.detail.contains("not there"),"no nostrod: how to get one");
Check(Explained(DaemonError(std::string(name),"could not start"),Operation::Send).problem==Problem::NoService,"a nostrod the bus could not start is no nostrod");
}
told=Explained(NoSystemBus("No such file or directory"),Operation::Load);
Check(told.problem==Problem::NoService&&told.retry&&!told.mayHaveHappened&&told.title=="The system bus cannot be reached"&&told.detail.contains("No such file or directory"),"no system bus to reach nostrod over");
Check(told.problem==Problem::Unknown&&told.mayHaveHappened&&!told.retry&&told.title=="It may have been paid"&&told.detail.contains("activity"),"a payment without a clear answer may have been made");
Check(told.problem==Problem::Unknown&&told.mayHaveHappened&&told.title=="It may have been done","and any other change may have been");
told=Explained(std::invalid_argument("no account is called 'Nope'"),Operation::Send);
Check(told.problem==Problem::Input&&!told.mayHaveHappened&&!told.retry&&told.detail=="no account is called 'Nope'. Nothing was sent.","what nostrod refused before it began");
Check(told.problem==Problem::NotConfirmed&&told.detail.contains("Nothing was done")&&told.detail.contains("agent"),"no password: nothing was done, and why no dialog may have come");
told=Explained(DaemonError("org.freedesktop.DBus.Error.AccessDenied","the system's policy does not allow it"),Operation::Send);
Check(told.problem==Problem::NotAllowed&&told.detail.starts_with("the system's policy does not allow it")&&!told.retry,"refused by the system's policy");
Check(Explained(DaemonError("org.freedesktop.DBus.Error.AccessDenied","no"),Operation::Load).retry,"a reading may be tried again");
Check(told.problem==Problem::OwnAccountsOnly&&told.title=="This connection cannot pay others"&&told.detail.contains("draft"),"a connection that pays the user's own accounts only");
Check(!told.detail.contains("bunq")&&!told.detail.contains("OAuth"),"said of no bank and of no way to connect to one");
told=Explained(DaemonError(std::string(Bus::errorBank),"bunq POST /payment: Not enough money. (400)"),Operation::Send);
Check(told.problem==Problem::Bank&&told.title=="The bank refused"&&told.detail.contains("Not enough money")&&!told.retry&&!told.mayHaveHappened,"the bank's own refusal");
Check(Explained(DaemonError(std::string(Bus::errorBank),"x"),Operation::Load).retry,"of a reading, which may be tried again");
Check(told.problem==Problem::Failed&&told.detail=="already connected"&&!told.mayHaveHappened&&!told.retry,"anything else it failed at is said as it says it");
Check(Explained(DaemonError(std::string(Bus::errorFailed),"x"),Operation::Load).retry,"and a reading may be tried again");
Check(bunq!=nullptr&&bunq->name=="bunq"&&bunq->ways.size()==2,"bunq is one of them, by its connector's own id, with two ways in");
Check(FindWay("bunq","api key")->form==ConnectForm::BunqKey&&FindWay("bunq","api key")->key=="key"&&!OwnAccountsOnly("bunq","api key"),"an API key, which does all a user can");
Check(FindWay("bunq","oauth")->form==ConnectForm::BunqOAuth&&FindWay("bunq","oauth")->key=="oauth"&&OwnAccountsOnly("bunq","oauth"),"and OAuth, which bunq lets pay between the user's own accounts only");
Equal(WayName("bunq","api key"),std::string("API key"),"as nostrod's \"api key\" is said");
Check(Revoking("bunq","api key").contains("API key")&&Revoking("bunq","oauth").contains("permission"),"each stays valid at bunq until it is revoked there");
Check(FindBank("thrift")==nullptr&&FindWay("thrift","api key")==nullptr&&FindWay("bunq","handshake")==nullptr,"a bank or a way the app does not know is not found");
Equal(BankName("thrift"),std::string("thrift"),"such a bank is said as nostrod calls it");
Equal(WayName("thrift","password"),std::string("password"),"and so is its way");
Equal(WayName("bunq","handshake"),std::string("handshake"),"or a new way of a bank it knows");
Check(!OwnAccountsOnly("thrift","oauth")&&!OwnAccountsOnly("bunq","handshake"),"of which the app knows no limit");
Check(Revoking("thrift","password").contains("at the bank")&&Revoking("bunq","handshake")==Revoking("thrift","password"),"and no more of revoking it than that it is done at the bank");