From a94e681196881e3f8fb18ecfd760ed3f59fa8ca1 Mon Sep 17 00:00:00 2001 From: reecepwarner <156042118+reecepwarner@users.noreply.github.com> Date: Wed, 29 May 2024 12:44:24 -0700 Subject: Template node branch to Develop Branch (#3) * init * changes * changes * created insert and deletion functions * unit testing homework3 * more unit tests * unit tests added * unit test and memory check added * Template node * essentially completed --------- Co-authored-by: rPatrickWarner --- CST 126/UnitTest2/UnitTest2.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 CST 126/UnitTest2/UnitTest2.cpp (limited to 'CST 126/UnitTest2/UnitTest2.cpp') diff --git a/CST 126/UnitTest2/UnitTest2.cpp b/CST 126/UnitTest2/UnitTest2.cpp new file mode 100644 index 0000000..6cbd9a5 --- /dev/null +++ b/CST 126/UnitTest2/UnitTest2.cpp @@ -0,0 +1,39 @@ +#include "pch.h" +#include "CppUnitTest.h" +#include "SinglyLinkedList.hpp" +using namespace Microsoft::VisualStudio::CppUnitTestFramework; + +namespace UnitTest2 +{ + { + TEST_CLASS(LinkedListUnitTests) + { + public: + + + TEST_METHOD(EmptyListHasZeroSize) + { + SinglyLinkedList linkedList{}; + + + + Assert::AreEqual(0ull, linkedlist._size); + } + + + + TEST_METHOD(AppendingLinkedList) + { + SinglyLinkedList linkedList{}; + ListNode* node = { + }; + node->_data = 5; + + bool success = Append(&linkedlist, node); + + Assert::AreEqual(5, linkedlist._head->_data); + } + }; + } + +} -- cgit v1.2.3