aboutsummaryrefslogtreecommitdiff
path: root/CST 126/UnitTest2/UnitTest2.cpp
diff options
context:
space:
mode:
authorrPatrickWarner <[email protected]>2024-05-08 20:37:08 -0700
committerrPatrickWarner <[email protected]>2024-05-08 20:37:08 -0700
commit75adf9df19d54cc1c4a511c702f1e11879ccdf89 (patch)
treee53f5f3430ef54c4cf60ed576cbb3e793a493fdb /CST 126/UnitTest2/UnitTest2.cpp
parentchanges (diff)
downloadhomework-1-reecepwarner-75adf9df19d54cc1c4a511c702f1e11879ccdf89.tar.xz
homework-1-reecepwarner-75adf9df19d54cc1c4a511c702f1e11879ccdf89.zip
changes
Diffstat (limited to 'CST 126/UnitTest2/UnitTest2.cpp')
-rw-r--r--CST 126/UnitTest2/UnitTest2.cpp39
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);
+ }
+ };
+ }
+
+}