summary refs log tree commit diff stats
path: root/rust/armstrong-numbers/tests
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-07 21:28:06 +0530
committerAndinus <andinus@nand.sh>2021-09-07 21:28:06 +0530
commit12352f4842414612cfb7fd2629f1409da6025174 (patch)
tree883e2e78e11f5bd004f133e569cfc29f72383256 /rust/armstrong-numbers/tests
parent541096f04729909a5bed0e837a5d3726e2adbfb2 (diff)
downloadexercism-12352f4842414612cfb7fd2629f1409da6025174.tar.gz
Rust: Add Armstrong Numbers
Diffstat (limited to 'rust/armstrong-numbers/tests')
-rw-r--r--rust/armstrong-numbers/tests/armstrong-numbers.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/rust/armstrong-numbers/tests/armstrong-numbers.rs b/rust/armstrong-numbers/tests/armstrong-numbers.rs
new file mode 100644
index 0000000..2163451
--- /dev/null
+++ b/rust/armstrong-numbers/tests/armstrong-numbers.rs
@@ -0,0 +1,54 @@
+use armstrong_numbers::*;
+
+#[test]
+fn test_zero_is_an_armstrong_number() {
+    assert!(is_armstrong_number(0))
+}
+
+#[test]
+#[ignore]
+fn test_single_digit_numbers_are_armstrong_numbers() {
+    assert!(is_armstrong_number(5))
+}
+
+#[test]
+#[ignore]
+fn test_there_are_no_2_digit_armstrong_numbers() {
+    assert!(!is_armstrong_number(10))
+}
+
+#[test]
+#[ignore]
+fn test_three_digit_armstrong_number() {
+    assert!(is_armstrong_number(153))
+}
+
+#[test]
+#[ignore]
+fn test_three_digit_non_armstrong_number() {
+    assert!(!is_armstrong_number(100))
+}
+
+#[test]
+#[ignore]
+fn test_four_digit_armstrong_number() {
+    assert!(is_armstrong_number(9474))
+}
+
+#[test]
+#[ignore]
+fn test_four_digit_non_armstrong_number() {
+    assert!(!is_armstrong_number(9475))
+}
+
+#[test]
+#[ignore]
+fn test_seven_digit_armstrong_number() {
+    assert!(is_armstrong_number(9_926_315))
+}
+
+#[test]
+#[ignore]
+fn test_seven_digit_non_armstrong_number() {
+    assert!(!is_armstrong_number(9_926_316))
+}