Mercurial > public > cpp-enigma
diff enigma/tests/test_machine.t.h @ 7:db1216d380b3
Added a set_rotor() that takes a string for convenience.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 29 Jun 2012 20:08:10 -0500 |
parents | 2792ca4ffa84 |
children | b90a41f0cd94 |
line wrap: on
line diff
--- a/enigma/tests/test_machine.t.h Tue Jun 26 21:22:42 2012 -0500 +++ b/enigma/tests/test_machine.t.h Fri Jun 29 20:08:10 2012 -0500 @@ -14,6 +14,25 @@ using namespace enigma; +class display_suite : public CxxTest::TestSuite +{ +public: + + void test_set_display3() + { + enigma_machine m({"II", "IV", "V"}, {}, "B"); + TS_ASSERT_THROWS(m.set_display("ABCD"), enigma_machine_error); + TS_ASSERT_THROWS_NOTHING(m.set_display("ABC")); + } + + void test_set_display4() + { + enigma_machine m({"Gamma", "II", "IV", "V"}, {}, "B-Thin"); + TS_ASSERT_THROWS(m.set_display("BCD"), enigma_machine_error); + TS_ASSERT_THROWS_NOTHING(m.set_display("ABCD")); + } +}; + class stepping_test_suite : public CxxTest::TestSuite { public: