petri

Trait RunTest

Source
pub trait RunTest: Send {
    type Artifacts;

    // Required methods
    fn leaf_name(&self) -> &str;
    fn resolve(&self, resolver: &ArtifactResolver<'_>) -> Self::Artifacts;
    fn run(
        &self,
        params: PetriTestParams<'_>,
        artifacts: Self::Artifacts,
    ) -> Result<()>;
}
Expand description

A test that can be run.

Register it to be run with test! or multitest!.

Required Associated Types§

Source

type Artifacts

The type of artifacts required by the test.

Required Methods§

Source

fn leaf_name(&self) -> &str

The leaf name of the test.

To produce the full test name, this will be prefixed with the module name where the test is defined.

Source

fn resolve(&self, resolver: &ArtifactResolver<'_>) -> Self::Artifacts

Returns the artifacts required by the test.

Source

fn run( &self, params: PetriTestParams<'_>, artifacts: Self::Artifacts, ) -> Result<()>

Runs the test, which has been assigned name, with the given artifacts.

Implementors§

Source§

impl<A, AR, F, E> RunTest for SimpleTest<A, F>
where A: 'static + Send + Fn(&ArtifactResolver<'_>) -> AR, F: 'static + Send + Fn(PetriTestParams<'_>, AR) -> Result<(), E>, E: Into<Error>,