use super::*;
#[test]
fn bootstrap_with_entity_without_use_cases_is_syntactically_valid() {
let entities = vec![puerto_toml::Entity {
name: "Invoice".to_string(),
use_cases: vec![],
db: false,
fields: vec![],
}];
let content = crate::generators::bootstrap::generate_bootstrap_content(&entities).unwrap();
assert!(!content.contains("{ ,"));
assert!(content.contains("let invoice_api = InvoiceApi {};"));
}
#[test]
fn bootstrap_with_use_cases_lists_them_in_the_api_initializer() {
let entities = vec![puerto_toml::Entity {
name: "Product".to_string(),
use_cases: vec!["create_product".into(), "get_product".into()],
db: false,
fields: vec![],
}];
let content = crate::generators::bootstrap::generate_bootstrap_content(&entities).unwrap();
assert!(content.contains("let product_api = ProductApi { create_product, get_product };"));
}