ranvier-test — Test Utilities for Ranvier Pipelines
Provides lightweight helpers that reduce boilerplate when unit-testing Transitions and Axon pipelines.
Quick Start
use ;
use Axon;
async
Provides lightweight helpers that reduce boilerplate when unit-testing Transitions and Axon pipelines.
use ranvier_test::{TestBus, TestAxon, assert_outcome_ok, assert_outcome_err};
use ranvier_runtime::Axon;
#[tokio::test]
async fn my_pipeline_test() {
let bus = TestBus::new().with(42_i32).with("config".to_string());
let axon = Axon::simple::<String>("test").then(my_transition);
let outcome = TestAxon::run(axon, (), &(), bus).await;
assert_outcome_ok!(outcome, |val| assert_eq!(val, expected));
}