diff --git a/list/linked_list_test.cc b/list/linked_list_test.cc new file mode 100644 index 0000000000000000000000000000000000000000..3880da4268ae8330e5dd9a5864af2d39ade16ed8 --- /dev/null +++ b/list/linked_list_test.cc @@ -0,0 +1,33 @@ +#include "catch.hpp" +#include "linked_list.h" + +using namespace std; + +TEST_CASE("Constructors") +{ +SECTION("empty list") +{ + +List list_object; +CHECK(list_object.List_Is_Empty()); +} + + +} +TEST_CASE("Insert") +{ +SECTION("insert single node") +{ +List list_object; +list_object.Insert_Node(1); +CHECK(list_object.at(0) == 1); +} + +SECTION("insert multiple nodes") +{ +List list_object2{4, 6, 7}; +CHECK(list_object2.at(0) == 4); +CHECK(list_object2.at(1) == 6); +CHECK(list_object2.at(2) == 7); +} +} \ No newline at end of file