use super::*;
use crate::stats::timeline::EventScope;
#[test]
fn fan_out_defaults_to_match() {
assert_eq!(
pending_event_definition("example", "Example", EventCategory::Other).scope,
EventScope::Match,
);
assert_eq!(SHOT_EVENT_DEFINITION.scope, EventScope::Match);
assert_eq!(TIMELINE_EVENT_DEFINITION.scope, EventScope::Match);
assert_eq!(
CORE_PLAYER_SCOREBOARD_EVENT_DEFINITION.scope,
EventScope::Match
);
assert_eq!(GOAL_CONTEXT_EVENT_DEFINITION.scope, EventScope::Match);
}
#[test]
fn control_and_contest_streams_are_team_scoped() {
for def in [
POSSESSION_EVENT_DEFINITION,
PRESSURE_EVENT_DEFINITION, TERRITORIAL_PRESSURE_EVENT_DEFINITION,
CONTROLLED_PLAY_EVENT_DEFINITION,
FIFTY_FIFTY_EVENT_DEFINITION,
RUSH_EVENT_DEFINITION,
] {
assert_eq!(
def.scope,
EventScope::Team,
"stream {} should be team-scoped",
def.id
);
}
}
#[test]
fn per_player_streams_fan_out_to_player_lanes() {
for def in [
FIELD_HALF_EVENT_DEFINITION,
FIELD_THIRD_EVENT_DEFINITION,
BALL_DEPTH_EVENT_DEFINITION,
BALL_THIRD_EVENT_DEFINITION,
DEPTH_ROLE_EVENT_DEFINITION,
BALL_PROXIMITY_EVENT_DEFINITION,
ROTATION_ROLE_EVENT_DEFINITION,
FIRST_MAN_CHANGE_EVENT_DEFINITION,
PLAYER_ACTIVITY_EVENT_DEFINITION,
MOVEMENT_EVENT_DEFINITION,
PLAYER_POSSESSION_EVENT_DEFINITION,
KICKOFF_EVENT_DEFINITION,
TOUCH_CLASSIFICATION_EVENT_DEFINITION,
FLICK_EVENT_DEFINITION,
DODGE_EVENT_DEFINITION,
DEMOLITION_EVENT_DEFINITION,
BOOST_PICKUP_EVENT_DEFINITION,
] {
assert_eq!(
def.scope,
EventScope::Player,
"stream {} should be player-scoped",
def.id
);
}
}