-
Notifications
You must be signed in to change notification settings - Fork 22
/
SectorExitPointLelnaTest.cpp
56 lines (47 loc) · 2.37 KB
/
SectorExitPointLelnaTest.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
50
51
52
53
54
55
56
#include "intention/SectorExitPointLelna.h"
using ::testing::NiceMock;
using ::testing::Return;
using UKControllerPlugin::IntentionCode::SectorExitPointLelna;
using UKControllerPluginTest::Euroscope::MockEuroscopeExtractedRouteInterface;
namespace UKControllerPluginTest::IntentionCode {
class SectorExitPointLelnaTest : public testing::Test
{
public:
SectorExitPointLelnaTest() : exitPoint("LELNA", "H8", SectorExitPointLelna::outSouth)
{
}
NiceMock<MockEuroscopeExtractedRouteInterface> routeMock;
SectorExitPointLelna exitPoint;
};
TEST_F(SectorExitPointLelnaTest, ItAppliesToAllControllers)
{
EXPECT_TRUE(exitPoint.AppliesToController("BLA"));
}
TEST_F(SectorExitPointLelnaTest, GetIntentionCodeReturnsCorrectDefaultCodeLelna)
{
ON_CALL(routeMock, GetPointsNumber()).WillByDefault(Return(2));
ON_CALL(routeMock, GetPointName(0)).WillByDefault(Return("LELNA"));
ON_CALL(routeMock, GetPointName(1)).WillByDefault(Return("LFMN"));
EXPECT_EQ(0, exitPoint.GetIntentionCode(routeMock, 0, 37000).compare("H8"));
}
TEST_F(SectorExitPointLelnaTest, GetIntentionCodeReturnsCorrectSecondaryCodeDomok)
{
ON_CALL(routeMock, GetPointsNumber()).WillByDefault(Return(3));
ON_CALL(routeMock, GetPointName(0)).WillByDefault(Return("LELNA"));
ON_CALL(routeMock, GetPointName(1)).WillByDefault(Return("DOMOK"));
ON_CALL(routeMock, GetPointName(2)).WillByDefault(Return("LEMD"));
EXPECT_EQ(0, exitPoint.GetIntentionCode(routeMock, 0, 37000).compare("H6"));
}
TEST_F(SectorExitPointLelnaTest, GetIntentionCodeReturnsCorrectIntentionCodeForBrestFirArrivals)
{
ON_CALL(routeMock, GetPointsNumber()).WillByDefault(Return(3));
ON_CALL(routeMock, GetPointName(2)).WillByDefault(Return("LFRO"));
EXPECT_EQ(0, exitPoint.GetIntentionCode(routeMock, 0, 37000).compare("H7"));
}
TEST_F(SectorExitPointLelnaTest, GetIntentionCodeReturnsCorrectIntentionCodeForCherbourgArrivals)
{
ON_CALL(routeMock, GetPointsNumber()).WillByDefault(Return(3));
ON_CALL(routeMock, GetPointName(2)).WillByDefault(Return("LFRC"));
EXPECT_EQ(0, exitPoint.GetIntentionCode(routeMock, 0, 25000).compare("JC"));
}
} // namespace UKControllerPluginTest::IntentionCode