interface_test.cpp 1.41 KB
Newer Older
Arun Das's avatar
Arun Das committed
1
/*******************************************************************************
Arun Das's avatar
Arun Das committed
2
3
4
5
6
7
8
9
 * Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *******************************************************************************/
Arun Das's avatar
Arun Das committed
10
11
12
13
14

//-----------------------------------------------------------------------------
/** @file  interface_test.cpp */
//-----------------------------------------------------------------------------

Arun Das's avatar
Arun Das committed
15
#include "MantleAPI/Test/test_utils.h"
Arun Das's avatar
Arun Das committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

TEST(InterfaceTest, GivenTeleportAction_When_ThenHostVehicleIsPlaced)
{
    mantle_api::Position inert_pos{};
    inert_pos = mantle_api::OpenDrivePosition{{0, 0}, 0, 0};
    mantle_api::MockEnvironment env{};
    env.CreateMap("dummy_map_path", {});

    mantle_api::VehicleProperties vehicle_properties;
    vehicle_properties.is_host = true;
    vehicle_properties.model = "G12";

    auto& repo = env.GetEntityRepository();
    auto& host_vehicle = repo.Create(0, "host", vehicle_properties);
    const auto* const converter = env.GetConverter();
    auto world_pos = converter->Convert(inert_pos);
    host_vehicle.SetPosition(world_pos);
33
    host_vehicle.SetVisibility(mantle_api::EntityVisibilityConfig{true, false, true, {"radar"}});
Arun Das's avatar
Arun Das committed
34
}