/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #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(CreateGameSession, Model::CreateGameSessionOutcome(const Model::CreateGameSessionRequest&)); MOCK_CONST_METHOD1(CreatePlayerSession, Model::CreatePlayerSessionOutcome(const Model::CreatePlayerSessionRequest&)); MOCK_CONST_METHOD1(SearchGameSessions, Model::SearchGameSessionsOutcome(const Model::SearchGameSessionsRequest&)); MOCK_CONST_METHOD1(StartGameSessionPlacement, Model::StartGameSessionPlacementOutcome(const Model::StartGameSessionPlacementRequest&)); }; 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()); };