cdevents_sdk/generated/
testoutput_published_0_1_0.rs#[cfg(feature = "testkit")] use proptest_derive::Arbitrary;
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "testkit", derive(Arbitrary))]
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "format",)]
pub format: String,
#[serde(rename = "outputType",)]
pub output_type: ContentOutputType,
#[serde(rename = "testCaseRun", default, skip_serializing_if = "Option::is_none",)]
pub test_case_run: Option<ContentTestCaseRun>,
#[serde(rename = "uri", default, skip_serializing_if = "Option::is_none",)]
pub uri: Option<crate::Uri>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "testkit", derive(Arbitrary))]
#[serde(deny_unknown_fields)]
pub struct ContentTestCaseRun {
#[serde(rename = "id",)]
pub id: crate::Id,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "testkit", derive(Arbitrary))]
pub enum ContentOutputType {
#[serde(rename = "report")]
Report,
#[serde(rename = "video")]
Video,
#[serde(rename = "image")]
Image,
#[serde(rename = "log")]
Log,
#[serde(rename = "other")]
Other,
}
#[cfg(test)]
mod tests {
use proptest::prelude::*;
use super::*;
proptest! {
#[test]
#[cfg(feature = "testkit")]
fn arbitraries_are_json_valid(s in any::<Content>()) {
let json_str = serde_json::to_string(&s).unwrap();
let actual = serde_json::from_str::<Content>(&json_str).unwrap();
assert_eq!(s, actual);
}
}
}