Skip to content
Snippets Groups Projects
Commit 242aa338 authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Add (yet simple) unit test for is_detector fn

parent 016ddd21
No related branches found
No related tags found
1 merge request!2Resolve "Add outgoing port to detector node"
Pipeline #7300 failed
...@@ -366,7 +366,7 @@ impl dyn OpticComponent + 'static { ...@@ -366,7 +366,7 @@ impl dyn OpticComponent + 'static {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::OpticNode; use super::OpticNode;
use crate::nodes::Dummy; use crate::nodes::{Dummy, Detector};
#[test] #[test]
fn new() { fn new() {
let node = OpticNode::new("Test", Dummy); let node = OpticNode::new("Test", Dummy);
...@@ -397,6 +397,13 @@ mod test { ...@@ -397,6 +397,13 @@ mod test {
assert_eq!(node.inverted(), true) assert_eq!(node.inverted(), true)
} }
#[test] #[test]
fn is_detector() {
let node = OpticNode::new("Test", Dummy);
assert_eq!(node.is_detector(), false);
let node = OpticNode::new("Test", Detector::default());
assert_eq!(node.is_detector(), true)
}
#[test]
#[ignore] #[ignore]
fn to_dot() { fn to_dot() {
let node = OpticNode::new("Test", Dummy); let node = OpticNode::new("Test", Dummy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment