/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Aws::GameLift; class GameLiftClientMock : public GameLiftClient { public: GameLiftClientMock() : GameLiftClient(Aws::Auth::AWSCredentials()) { } MOCK_CONST_METHOD1(AcceptMatch, Model::AcceptMatchOutcome(const Model::AcceptMatchRequest&)); MOCK_CONST_METHOD1(CreateGameSession, Model::CreateGameSessionOutcome(const Model::CreateGameSessionRequest&)); MOCK_CONST_METHOD1(CreatePlayerSession, Model::CreatePlayerSessionOutcome(const Model::CreatePlayerSessionRequest&)); MOCK_CONST_METHOD1(DescribeMatchmaking, Model::DescribeMatchmakingOutcome(const Model::DescribeMatchmakingRequest&)); MOCK_CONST_METHOD1(SearchGameSessions, Model::SearchGameSessionsOutcome(const Model::SearchGameSessionsRequest&)); MOCK_CONST_METHOD1(StartGameSessionPlacement, Model::StartGameSessionPlacementOutcome(const Model::StartGameSessionPlacementRequest&)); MOCK_CONST_METHOD1(StartMatchmaking, Model::StartMatchmakingOutcome(const Model::StartMatchmakingRequest&)); MOCK_CONST_METHOD1(StopMatchmaking, Model::StopMatchmakingOutcome(const Model::StopMatchmakingRequest&)); }; class MatchmakingAsyncRequestNotificationsHandlerMock : public AzFramework::MatchmakingAsyncRequestNotificationBus::Handler { public: MatchmakingAsyncRequestNotificationsHandlerMock() { AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusConnect(); } ~MatchmakingAsyncRequestNotificationsHandlerMock() { AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD0(OnAcceptMatchAsyncComplete, void()); MOCK_METHOD1(OnStartMatchmakingAsyncComplete, void(const AZStd::string&)); MOCK_METHOD0(OnStopMatchmakingAsyncComplete, void()); }; class MatchAcceptanceNotificationsHandlerMock : public AzFramework::MatchAcceptanceNotificationBus::Handler { public: MatchAcceptanceNotificationsHandlerMock() { AzFramework::MatchAcceptanceNotificationBus::Handler::BusConnect(); } ~MatchAcceptanceNotificationsHandlerMock() { AzFramework::MatchAcceptanceNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD0(OnMatchAcceptance, void()); }; class SessionAsyncRequestNotificationsHandlerMock : public AzFramework::SessionAsyncRequestNotificationBus::Handler { public: SessionAsyncRequestNotificationsHandlerMock() { AzFramework::SessionAsyncRequestNotificationBus::Handler::BusConnect(); } ~SessionAsyncRequestNotificationsHandlerMock() { AzFramework::SessionAsyncRequestNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD1(OnCreateSessionAsyncComplete, void(const AZStd::string&)); MOCK_METHOD1(OnSearchSessionsAsyncComplete, void(const AzFramework::SearchSessionsResponse&)); MOCK_METHOD1(OnJoinSessionAsyncComplete, void(bool)); MOCK_METHOD0(OnLeaveSessionAsyncComplete, void()); }; class SessionHandlingClientRequestsMock : public AzFramework::ISessionHandlingClientRequests { public: SessionHandlingClientRequestsMock() { AZ::Interface::Register(this); } virtual ~SessionHandlingClientRequestsMock() { AZ::Interface::Unregister(this); } MOCK_METHOD1(RequestPlayerJoinSession, bool(const AzFramework::SessionConnectionConfig&)); MOCK_METHOD0(RequestPlayerLeaveSession, void()); };