MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / test_convert_event

Function test_convert_event

tests/outbox.rs:73–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72 #[tokio::test]
73 async fn test_convert_event() {
74 run_test(async {
75 let (context_manager, _) = ContextManager::new().await;
76 outbox_setup().await;
77
78 '_test_case: {
79 let vec_of_outbox = Outbox::get(context_manager.read().await.executor())
80 .await
81 .unwrap();
82
83 assert_eq!(vec_of_outbox.len(), 1);
84 let event = vec_of_outbox.get(0).unwrap().convert_event();
85 assert!(event.externally_notifiable());
86
87 let converted = serde_json::from_str(&event.state()).unwrap();
88 match converted {
89 BoardCreated { .. } => {
90 println!("Success!")
91 }
92 _ => {
93 panic!("Failed!")
94 }
95 };
96 }
97 })
98 .await
99 }
100
101 #[tokio::main]
102 #[test]

Callers

nothing calls this directly

Calls 5

outbox_setupFunction · 0.85
convert_eventMethod · 0.80
run_testFunction · 0.70
executorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected