Skip to main content

test_spec_handler

Macro test_spec_handler 

Source
macro_rules! test_spec_handler {
    (
        impl $handler:ident {
            defaults [$($default:ident),* $(,)?]
            $($custom:item)*
        }
    ) => { ... };
}
Expand description

Supplies standard no-op SpecHandler methods for test doubles.

List required methods that should use their neutral test implementation. Write required overrides and optional trait methods as ordinary items.

use wowlab_engine_ports::{SimContext, SpecAction, test_spec_handler};

struct IdleHandler;

test_spec_handler! {
    impl IdleHandler {
        defaults [
            on_player_ready,
            on_cast_complete,
            on_sim_start,
            total_damage,
            cast_time_ms,
        ]
    }
}

let _ = (IdleHandler, None::<SpecAction>, None::<SimContext<'static>>);