Skip to content

Commit 4074911

Browse files
Merge pull request #1 from Botts-Innovative-Research/dev
Initial implementation
2 parents edaeb1f + 5b7ea2b commit 4074911

86 files changed

Lines changed: 9165 additions & 45 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
# debug information files
4343
*.dwo
44-
/CSAPI-lib/x64/Debug
44+
/CSAPI/x64/Debug
4545
/x64/Debug
4646
/CSAPI-test/x64/Debug
47+
48+
*/vcpkg_installed/*

.idea/workspace.xml

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CSAPI-test/CSAPI-test.vcxproj

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>17.0</VCProjectVersion>
23+
<ProjectGuid>{4AEFD5AB-D2F6-FCC8-5352-79A01F5826D8}</ProjectGuid>
24+
<Keyword>Win32Proj</Keyword>
25+
<RootNamespace>CSAPItest</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
<ProjectSubType>NativeUnitTestProject</ProjectSubType>
28+
</PropertyGroup>
29+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
31+
<ConfigurationType>DynamicLibrary</ConfigurationType>
32+
<UseDebugLibraries>true</UseDebugLibraries>
33+
<PlatformToolset>v145</PlatformToolset>
34+
<CharacterSet>Unicode</CharacterSet>
35+
<UseOfMfc>false</UseOfMfc>
36+
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
38+
<ConfigurationType>DynamicLibrary</ConfigurationType>
39+
<UseDebugLibraries>false</UseDebugLibraries>
40+
<PlatformToolset>v145</PlatformToolset>
41+
<WholeProgramOptimization>true</WholeProgramOptimization>
42+
<CharacterSet>Unicode</CharacterSet>
43+
<UseOfMfc>false</UseOfMfc>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
46+
<ConfigurationType>DynamicLibrary</ConfigurationType>
47+
<UseDebugLibraries>true</UseDebugLibraries>
48+
<PlatformToolset>v145</PlatformToolset>
49+
<CharacterSet>Unicode</CharacterSet>
50+
<UseOfMfc>false</UseOfMfc>
51+
</PropertyGroup>
52+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
53+
<ConfigurationType>DynamicLibrary</ConfigurationType>
54+
<UseDebugLibraries>false</UseDebugLibraries>
55+
<PlatformToolset>v145</PlatformToolset>
56+
<WholeProgramOptimization>true</WholeProgramOptimization>
57+
<CharacterSet>Unicode</CharacterSet>
58+
<UseOfMfc>false</UseOfMfc>
59+
</PropertyGroup>
60+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
61+
<ImportGroup Label="ExtensionSettings">
62+
</ImportGroup>
63+
<ImportGroup Label="Shared">
64+
</ImportGroup>
65+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
66+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+
</ImportGroup>
68+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
69+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
70+
</ImportGroup>
71+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
72+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
73+
</ImportGroup>
74+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
75+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
76+
</ImportGroup>
77+
<PropertyGroup Label="UserMacros" />
78+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
79+
<LinkIncremental>true</LinkIncremental>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
82+
<LinkIncremental>true</LinkIncremental>
83+
</PropertyGroup>
84+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
85+
<LinkIncremental>false</LinkIncremental>
86+
</PropertyGroup>
87+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
88+
<LinkIncremental>false</LinkIncremental>
89+
</PropertyGroup>
90+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
91+
<ClCompile>
92+
<PrecompiledHeader>Use</PrecompiledHeader>
93+
<WarningLevel>Level3</WarningLevel>
94+
<SDLCheck>true</SDLCheck>
95+
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);..\CSAPI\;.</AdditionalIncludeDirectories>
96+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97+
<UseFullPaths>true</UseFullPaths>
98+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
99+
<LanguageStandard>stdcpp17</LanguageStandard>
100+
</ClCompile>
101+
<Link>
102+
<SubSystem>Windows</SubSystem>
103+
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
104+
</Link>
105+
</ItemDefinitionGroup>
106+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
107+
<ClCompile>
108+
<PrecompiledHeader>Use</PrecompiledHeader>
109+
<WarningLevel>Level3</WarningLevel>
110+
<SDLCheck>true</SDLCheck>
111+
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);..\CSAPI\;.</AdditionalIncludeDirectories>
112+
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113+
<UseFullPaths>true</UseFullPaths>
114+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
115+
</ClCompile>
116+
<Link>
117+
<SubSystem>Windows</SubSystem>
118+
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
119+
</Link>
120+
</ItemDefinitionGroup>
121+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
122+
<ClCompile>
123+
<PrecompiledHeader>Use</PrecompiledHeader>
124+
<WarningLevel>Level3</WarningLevel>
125+
<FunctionLevelLinking>true</FunctionLevelLinking>
126+
<IntrinsicFunctions>true</IntrinsicFunctions>
127+
<SDLCheck>true</SDLCheck>
128+
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);..\CSAPI\;.</AdditionalIncludeDirectories>
129+
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130+
<UseFullPaths>true</UseFullPaths>
131+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
132+
</ClCompile>
133+
<Link>
134+
<SubSystem>Windows</SubSystem>
135+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
136+
<OptimizeReferences>true</OptimizeReferences>
137+
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
138+
</Link>
139+
</ItemDefinitionGroup>
140+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
141+
<ClCompile>
142+
<PrecompiledHeader>Use</PrecompiledHeader>
143+
<WarningLevel>Level3</WarningLevel>
144+
<FunctionLevelLinking>true</FunctionLevelLinking>
145+
<IntrinsicFunctions>true</IntrinsicFunctions>
146+
<SDLCheck>true</SDLCheck>
147+
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);..\CSAPI\;.</AdditionalIncludeDirectories>
148+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
149+
<UseFullPaths>true</UseFullPaths>
150+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
151+
<LanguageStandard>stdcpp17</LanguageStandard>
152+
</ClCompile>
153+
<Link>
154+
<SubSystem>Windows</SubSystem>
155+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
156+
<OptimizeReferences>true</OptimizeReferences>
157+
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
158+
</Link>
159+
</ItemDefinitionGroup>
160+
<ItemGroup>
161+
<ClCompile Include="IntegrationTests\ControlStreamsTest.cpp" />
162+
<ClCompile Include="IntegrationTests\DataStreamsTest.cpp" />
163+
<ClCompile Include="IntegrationTests\ObservationsTest.cpp" />
164+
<ClCompile Include="IntegrationTests\SystemsTest.cpp" />
165+
<ClCompile Include="UnitTests\ConnectedSystemsAPITest.cpp" />
166+
<ClCompile Include="pch.cpp">
167+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
168+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
169+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
170+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
171+
</ClCompile>
172+
</ItemGroup>
173+
<ItemGroup>
174+
<ClInclude Include="pch.h" />
175+
<ClInclude Include="TestHelper.h" />
176+
</ItemGroup>
177+
<ItemGroup>
178+
<None Include="vcpkg.json" />
179+
</ItemGroup>
180+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
181+
<ImportGroup Label="ExtensionTargets">
182+
</ImportGroup>
183+
</Project>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
<Filter Include="IntegrationTests">
17+
<UniqueIdentifier>{8A9F5E2D-3B4C-4D6E-9F7A-1C2B3D4E5F6A}</UniqueIdentifier>
18+
</Filter>
19+
<Filter Include="UnitTests">
20+
<UniqueIdentifier>{1B2E4F7A-9C3D-4E5F-8A6B-0D1C2E3F4A5B}</UniqueIdentifier>
21+
</Filter>
22+
</ItemGroup>
23+
<ItemGroup>
24+
<ClCompile Include="pch.cpp">
25+
<Filter>Source Files</Filter>
26+
</ClCompile>
27+
<ClCompile Include="IntegrationTests\SystemsTest.cpp">
28+
<Filter>IntegrationTests</Filter>
29+
</ClCompile>
30+
<ClCompile Include="IntegrationTests\DataStreamsTest.cpp">
31+
<Filter>IntegrationTests</Filter>
32+
</ClCompile>
33+
<ClCompile Include="IntegrationTests\ObservationsTest.cpp">
34+
<Filter>IntegrationTests</Filter>
35+
</ClCompile>
36+
<ClCompile Include="IntegrationTests\ControlStreamsTest.cpp">
37+
<Filter>IntegrationTests</Filter>
38+
</ClCompile>
39+
<ClCompile Include="UnitTests\ConnectedSystemsAPITest.cpp">
40+
<Filter>UnitTests</Filter>
41+
</ClCompile>
42+
</ItemGroup>
43+
<ItemGroup>
44+
<ClInclude Include="pch.h">
45+
<Filter>Header Files</Filter>
46+
</ClInclude>
47+
<ClInclude Include="TestHelper.h">
48+
<Filter>Header Files</Filter>
49+
</ClInclude>
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="vcpkg.json" />
53+
</ItemGroup>
54+
</Project>

ConnectedSystemsAPI-CPP/ConnectedSystemsAPI-CPP.vcxproj.user renamed to CSAPI-test/CSAPI-test.vcxproj.user

File renamed without changes.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#include <string>
2+
3+
#include "pch.h"
4+
#include "CppUnitTest.h"
5+
#include "ConnectedSystemsAPI.h"
6+
#include "TestHelper.h"
7+
#include "DataModels/ControlStream.h"
8+
9+
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
10+
using namespace std::string_literals;
11+
12+
namespace CSAPItest {
13+
TEST_CLASS(ControlStreamsTest)
14+
{
15+
TestHelper testHelper;
16+
17+
TEST_METHOD_INITIALIZE(ClassInitialize) {
18+
testHelper = TestHelper();
19+
}
20+
21+
TEST_METHOD_CLEANUP(MethodCleanup) {
22+
testHelper.cleanupTestSystem();
23+
}
24+
25+
TEST_METHOD(GetControlStreams) {
26+
auto response = testHelper.csapi.getControlStreamsAPI().getControlStreams();
27+
Assert::IsTrue(response.isSuccessful());
28+
}
29+
30+
TEST_METHOD(GetControlStreamsOfSystem) {
31+
auto systemsResponse = testHelper.csapi.getSystemsAPI().getSystems();
32+
Assert::IsTrue(systemsResponse.isSuccessful());
33+
Assert::IsFalse(systemsResponse.getItems().empty());
34+
auto systemId = systemsResponse.getItems().front().getId();
35+
auto response = testHelper.csapi.getControlStreamsAPI().getControlStreamsOfSystem(systemId);
36+
Assert::IsTrue(response.isSuccessful());
37+
}
38+
39+
TEST_METHOD(GetControlStreamsById) {
40+
auto controlStreamsResponse = testHelper.csapi.getControlStreamsAPI().getControlStreams();
41+
Assert::IsTrue(controlStreamsResponse.isSuccessful());
42+
Assert::IsFalse(controlStreamsResponse.getItems().empty());
43+
auto controlStreamId = controlStreamsResponse.getItems().front().getId().value_or("");
44+
auto response = testHelper.csapi.getControlStreamsAPI().getControlStreamById(controlStreamId);
45+
Assert::IsTrue(response.isSuccessful());
46+
}
47+
48+
TEST_METHOD(GetControlStreamSchema) {
49+
auto controlStreamsResponse = testHelper.csapi.getControlStreamsAPI().getControlStreams();
50+
Assert::IsTrue(controlStreamsResponse.isSuccessful());
51+
Assert::IsFalse(controlStreamsResponse.getItems().empty());
52+
auto controlStreamId = controlStreamsResponse.getItems().front().getId().value_or("");
53+
auto response = testHelper.csapi.getControlStreamsAPI().getControlStreamSchema(controlStreamId);
54+
Assert::IsTrue(response.isSuccessful());
55+
}
56+
57+
TEST_METHOD(CreateControlStream) {
58+
auto systemId = testHelper.createTestSystem();
59+
auto controlStream = testHelper.createTestControlStreamObject();
60+
std::cout << "Creating Control Stream: " << controlStream << std::endl;
61+
auto response = testHelper.csapi.getControlStreamsAPI().createControlStream(systemId, controlStream);
62+
std::cout << "Created Control Stream Response: " << response.getResponseMessage() << std::endl;
63+
Assert::IsTrue(response.isSuccessful());
64+
}
65+
66+
TEST_METHOD(DeleteControlStream) {
67+
auto systemId = testHelper.createTestSystem();
68+
auto controlStreamId = testHelper.createTestControlStream(systemId);
69+
testHelper.csapi.getControlStreamsAPI().deleteControlStream(controlStreamId, true);
70+
}
71+
};
72+
}

0 commit comments

Comments
 (0)