diff options
Diffstat (limited to 'CST 126/UnitTest2/UnitTest2.cpp')
| -rw-r--r-- | CST 126/UnitTest2/UnitTest2.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
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); + } + }; + } + +} |