Struct umm::grade::ByUnitTestGrader
source · pub struct ByUnitTestGrader {
test_files: Array,
expected_tests: Array,
project: Project,
out_of: f64,
req_name: String,
}
Expand description
Grades by running tests, and reports how many tests pass. Final grade is the same percentage of maximum grade as the number of tests passing.
Fields§
§test_files: Array
A list of test files to run.
expected_tests: Array
A list of test names that should be found. Grade returned is 0 if any are not found.
project: Project
A reference to the project the test files belong to.
out_of: f64
Maximum possible grade.
req_name: String
Display name for requirement to use while displaying grade result
Implementations§
source§impl ByUnitTestGrader
impl ByUnitTestGrader
sourcepub fn test_files(&mut self) -> Array
pub fn test_files(&mut self) -> Array
Getter for test_files
sourcepub fn set_test_files(self, test_files: Array) -> Self
pub fn set_test_files(self, test_files: Array) -> Self
Setter for test_files
sourcepub fn expected_tests(&mut self) -> Array
pub fn expected_tests(&mut self) -> Array
Getter for expected_tests
sourcepub fn set_expected_tests(self, expected_tests: Array) -> Self
pub fn set_expected_tests(self, expected_tests: Array) -> Self
Setter for expected_tests
sourcepub fn set_project(self, project: Project) -> Self
pub fn set_project(self, project: Project) -> Self
Setter for project
sourcepub fn set_out_of(self, out_of: f64) -> Self
pub fn set_out_of(self, out_of: f64) -> Self
Setter for out_of
sourcepub fn set_req_name(self, req_name: String) -> Self
pub fn set_req_name(self, req_name: String) -> Self
Setter for req_name
sourcepub fn grade_by_tests(self) -> Result<GradeResult>
pub fn grade_by_tests(self) -> Result<GradeResult>
Grades by running tests, and reports how many tests pass. Final grade is the same percentage of maximum grade as the number of tests passing.
sourcepub fn grade_by_tests_script(self) -> Result<GradeResult, Box<EvalAltResult>>
pub fn grade_by_tests_script(self) -> Result<GradeResult, Box<EvalAltResult>>
Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.
Trait Implementations§
source§impl Clone for ByUnitTestGrader
impl Clone for ByUnitTestGrader
source§fn clone(&self) -> ByUnitTestGrader
fn clone(&self) -> ByUnitTestGrader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CustomType for ByUnitTestGrader
impl CustomType for ByUnitTestGrader
Allows registering custom types with Rhai