From 712b26c06593ed5ea0031b99cc9252a6b6f36111 Mon Sep 17 00:00:00 2001 From: Logan Date: Wed, 17 Apr 2024 19:27:16 -0700 Subject: Created Unit_Tests --- CST 126/CST_126.sln | 10 ++ CST 126/unit_tests/pch.cpp | 5 + CST 126/unit_tests/pch.h | 12 ++ CST 126/unit_tests/unit_tests.cpp | 24 ++++ CST 126/unit_tests/unit_tests.vcxproj | 175 ++++++++++++++++++++++++++ CST 126/unit_tests/unit_tests.vcxproj.filters | 30 +++++ 6 files changed, 256 insertions(+) create mode 100644 CST 126/unit_tests/pch.cpp create mode 100644 CST 126/unit_tests/pch.h create mode 100644 CST 126/unit_tests/unit_tests.cpp create mode 100644 CST 126/unit_tests/unit_tests.vcxproj create mode 100644 CST 126/unit_tests/unit_tests.vcxproj.filters diff --git a/CST 126/CST_126.sln b/CST 126/CST_126.sln index 91644a9..e998f0a 100644 --- a/CST 126/CST_126.sln +++ b/CST 126/CST_126.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.7.34031.279 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Homework 1", "Homework 1\Homework 1.vcxproj", "{63480B39-FB46-498B-A592-F4EAAF597F78}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Unit_Tests", "unit_tests\unit_tests.vcxproj", "{1A2D3083-2F74-495F-A650-F98E482E5B36}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -21,6 +23,14 @@ Global {63480B39-FB46-498B-A592-F4EAAF597F78}.Release|x64.Build.0 = Release|x64 {63480B39-FB46-498B-A592-F4EAAF597F78}.Release|x86.ActiveCfg = Release|Win32 {63480B39-FB46-498B-A592-F4EAAF597F78}.Release|x86.Build.0 = Release|Win32 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Debug|x64.ActiveCfg = Debug|x64 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Debug|x64.Build.0 = Debug|x64 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Debug|x86.ActiveCfg = Debug|Win32 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Debug|x86.Build.0 = Debug|Win32 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Release|x64.ActiveCfg = Release|x64 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Release|x64.Build.0 = Release|x64 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Release|x86.ActiveCfg = Release|Win32 + {1A2D3083-2F74-495F-A650-F98E482E5B36}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CST 126/unit_tests/pch.cpp b/CST 126/unit_tests/pch.cpp new file mode 100644 index 0000000..64b7eef --- /dev/null +++ b/CST 126/unit_tests/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/CST 126/unit_tests/pch.h b/CST 126/unit_tests/pch.h new file mode 100644 index 0000000..9d715b0 --- /dev/null +++ b/CST 126/unit_tests/pch.h @@ -0,0 +1,12 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here + +#endif //PCH_H diff --git a/CST 126/unit_tests/unit_tests.cpp b/CST 126/unit_tests/unit_tests.cpp new file mode 100644 index 0000000..661ec9c --- /dev/null +++ b/CST 126/unit_tests/unit_tests.cpp @@ -0,0 +1,24 @@ +#include "pch.h" +#include "CppUnitTest.h" + +using namespace Microsoft::VisualStudio::CppUnitTestFramework; + +namespace unittests +{ + TEST_CLASS(unittests) + { + public: + + TEST_METHOD(Addition_Function_Overloads_Correctly) + { + //Arrange + + //Act + int result = add(15, 15, 15); + + //Assert + + Assert::AreEqual(45, result); + } + }; +} diff --git a/CST 126/unit_tests/unit_tests.vcxproj b/CST 126/unit_tests/unit_tests.vcxproj new file mode 100644 index 0000000..deab223 --- /dev/null +++ b/CST 126/unit_tests/unit_tests.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + {1A2D3083-2F74-495F-A650-F98E482E5B36} + Win32Proj + unittests + 10.0 + NativeUnitTestProject + Unit_Tests + + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + + + + + + + + + + + + + + + + + + + true + ../Homework 1;$(IncludePath) + + + true + + + false + + + false + + + + Use + Level3 + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + _DEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + NDEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Create + Create + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/CST 126/unit_tests/unit_tests.vcxproj.filters b/CST 126/unit_tests/unit_tests.vcxproj.filters new file mode 100644 index 0000000..78402ca --- /dev/null +++ b/CST 126/unit_tests/unit_tests.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file -- cgit v1.2.3