pub struct TestClass {
pub stub_context: Vec<StubContextType>,
pub test_functions: Vec<TestFunction>,
}
Expand description
The representation of a TestClass containing different contexts for con-/destructor, setUp, tearDown methods and so on and a vector of test functions.
Fields§
§stub_context: Vec<StubContextType>
§test_functions: Vec<TestFunction>
Implementations§
Source§impl TestClass
impl TestClass
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new StubContext instance.
§Example
use thinlinelib::synthesis::{TestClass};
let mut test_class = TestClass::new();
assert!(test_class.stub_context.is_empty());
assert!(test_class.test_functions.is_empty());
Sourcepub fn add_stub_context(&mut self, context: StubContextType) -> Option<&String>
pub fn add_stub_context(&mut self, context: StubContextType) -> Option<&String>
Adds a StubContext to the TestClass instance.
With setting stub contexts to certain values, it is ensured, that these contexts (e.g. test class constructor or setUp function) are replaced with the values to generate specific test classes.
§Example
use thinlinelib::synthesis::{StubContextType, TestClass};
let mut test_class = TestClass::new();
let stub_context_type = StubContextType::SetUpContext(String::from("setup = new Setup();"));
test_class.add_stub_context(stub_context_type);
assert_eq!(test_class.stub_context.len(), 1);
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TestClass
impl<'de> Deserialize<'de> for TestClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl EntityConversion for TestClass
impl EntityConversion for TestClass
impl StructuralPartialEq for TestClass
Auto Trait Implementations§
impl Freeze for TestClass
impl RefUnwindSafe for TestClass
impl Send for TestClass
impl Sync for TestClass
impl Unpin for TestClass
impl UnwindSafe for TestClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more