[][src]Struct kevlar::TestEvent

pub struct TestEvent { /* fields omitted */ }

A TestEvent is any event that you want to highlight during the test. Typically this will be a test failure but you might also want to capture other events also.

Methods

impl TestEvent[src]

pub fn new(status: TestStatus) -> Self[src]

Create a new TestEvent.

pub fn with_description(self, description: &str) -> Self[src]

Supply a description to the TestEvent. Supports chaining.

Example:

TestEvent::new(TestStatus::Failed).with_description("Something went wrong")

pub fn with_artifact(self, artifact: TestArtifact) -> Self[src]

Supply an artifact to the TestEvent. Supports chaining. You can add multiple artifacts by chaining this several times.

Example:

let event = TestEvent::new(TestStatus::Failed)
    .with_description("Something went wrong")
    .with_artifact(artifact1)
    .with_artifact(artifact2);

pub fn set_description(&mut self, description: &str)[src]

Set the description of this event. This will override any existing description if one was already specified.

pub fn add_artifact(&mut self, artifact: TestArtifact)[src]

Add an artifact to this event.

Trait Implementations

impl Display for TestEvent[src]

impl Debug for TestEvent[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]