Trait exonum_testkit::compare::ComparableSnapshot
[−]
[src]
pub trait ComparableSnapshot<S> { fn compare(self, old: S) -> Comparison<Box<Snapshot>>; }
Trait facilitating comparison between 2 Snapshot
s taken at different times.
Examples
Typical usage involves map
ping the resulting comparison through the schema:
ⓘThis example is not tested
let mut testkit = ...; let old_snapshot = testkit.snapshot(); // Mutate the testkit state somehow... testkit.snapshot() .compare(old_snapshot) .map(ServiceSchema::new) .assert("Something about the schema", |old, schema| { // Assertions... });
Here ServiceSchema
is a public struct defined in a service library that has public new
method with a signature like fn<S: AsRef<Snapshot>>(view: S) -> Self
.
Required Methods
fn compare(self, old: S) -> Comparison<Box<Snapshot>>
Compares this snapshot with an older one.