pub struct ContractTester<'a> { /* private fields */ }Expand description
Contract tester for API routes
Implementations§
Source§impl<'a> ContractTester<'a>
impl<'a> ContractTester<'a>
Sourcepub fn with_config(router: &'a Router, config: ContractTestConfig) -> Self
pub fn with_config(router: &'a Router, config: ContractTestConfig) -> Self
Create with custom configuration
Sourcepub fn test_all_routes(&self) -> ContractTestResults
pub fn test_all_routes(&self) -> ContractTestResults
Test all routes
Sourcepub fn test_route(&self, route: &RouteMetadata) -> ContractTestResult
pub fn test_route(&self, route: &RouteMetadata) -> ContractTestResult
Test a specific route
Sourcepub fn generate_test_code(&self, route: &RouteMetadata) -> String
pub fn generate_test_code(&self, route: &RouteMetadata) -> String
Generate contract test for a route
Sourcepub fn coverage_stats(&self) -> HashMap<String, f64>
pub fn coverage_stats(&self) -> HashMap<String, f64>
Get coverage statistics
Auto Trait Implementations§
impl<'a> Freeze for ContractTester<'a>
impl<'a> !RefUnwindSafe for ContractTester<'a>
impl<'a> Send for ContractTester<'a>
impl<'a> Sync for ContractTester<'a>
impl<'a> Unpin for ContractTester<'a>
impl<'a> !UnwindSafe for ContractTester<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request