Introduce TestContextBuilder

There are too many ways to create a TestContext, this introduces a
TestContextBuilder to try and keep this shorter.  It also cleans up
the existing constructors keeping only the commonly used ones.
This commit is contained in:
Floris Bruynooghe
2021-12-12 19:09:10 +01:00
parent 83137b5968
commit f0ca50ba27
6 changed files with 110 additions and 88 deletions

View File

@@ -1525,9 +1525,9 @@ mod tests {
let t = TestContext::new().await;
assert_eq!(t.is_self_addr("me@me.org").await?, false);
let addr = t.configure_alice().await;
t.configure_addr("you@you.net").await;
assert_eq!(t.is_self_addr("me@me.org").await?, false);
assert_eq!(t.is_self_addr(&addr).await?, true);
assert_eq!(t.is_self_addr("you@you.net").await?, true);
Ok(())
}