-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathControlPlaneProviderTests.cpp
50 lines (38 loc) · 1.38 KB
/
ControlPlaneProviderTests.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#if 0
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
#include "common/Common.hpp"
#include "IControlPlane.hpp"
using namespace testing;
using namespace MAT;
static const size_t ConfigV0Size = sizeof(size_t) + sizeof(LPCSTR);
TEST(ControlPlaneProviderTests, ControlPlaneConfig_CtorSetsExpectedDefaults)
{
// Note that this test will need to be updated every time the ControlPlaneConfiguration
// structure changes
ControlPlaneConfiguration config;
ASSERT_EQ(ConfigV0Size, config.structSize);
ASSERT_EQ(nullptr, config.cacheFilePathRoot);
}
TEST(ControlPlaneProviderTests, GetControlPlane_ConfigHasInvalidSize_ReturnsNullptr)
{
ControlPlaneConfiguration config;
config.structSize = 0;
ASSERT_EQ(nullptr, ControlPlaneProvider::GetControlPlane(config));
}
TEST(ControlPlaneProviderTests, GetControlPlane_ConfigHasV0Size_ConfigHasNoCachePath_ReturnsNullptr)
{
ControlPlaneConfiguration config;
config.structSize = ConfigV0Size;
ASSERT_EQ(nullptr, ControlPlaneProvider::GetControlPlane(config));
}
TEST(ControlPlaneProviderTests, GetControlPlane_ConfigHasV0Size_ConfigHasCachePath_ReturnsControlPlane)
{
ControlPlaneConfiguration config;
config.structSize = ConfigV0Size;
config.cacheFilePathRoot = "A Path";
ASSERT_NE(nullptr, ControlPlaneProvider::GetControlPlane(config));
}
#endif