crates/monetize-proto/tests/default_stubs.rs
//! ★ **A test fake writes only the calls its test makes** (`default-stubs`, gunnar-ui
//! 2026-10-27): with the feature, a server trait with no methods written compiles, and every
//! call it was not given answers UNIMPLEMENTED, so the next RPC monetize adds breaks no fake.
#![cfg(feature = "default-stubs")]
use monetize_proto::estate_order_server::EstateOrder;
use monetize_proto::purchase_server::Purchase;
struct Nothing;
#[tonic::async_trait]
impl EstateOrder for Nothing {}
#[tonic::async_trait]
impl Purchase for Nothing {}
#[tokio::test]
async fn a_call_the_fake_was_not_given_answers_unimplemented() {
let refused = EstateOrder::status(&Nothing, tonic::Request::new(Default::default())).await.expect_err("not written");
assert_eq!(refused.code(), tonic::Code::Unimplemented, "{refused:?}");
let refused = Purchase::quote(&Nothing, tonic::Request::new(Default::default())).await.expect_err("not written");
assert_eq!(refused.code(), tonic::Code::Unimplemented, "{refused:?}");
}