AWSGameLiftStopMatchmakingActivityTest.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Activity/AWSGameLiftStopMatchmakingActivity.h>
  9. #include <AWSGameLiftClientFixture.h>
  10. #include <aws/gamelift/model/StopMatchmakingRequest.h>
  11. using namespace AWSGameLift;
  12. using AWSGameLiftStopMatchmakingActivityTest = AWSGameLiftClientFixture;
  13. TEST_F(AWSGameLiftStopMatchmakingActivityTest, BuildAWSGameLiftStopMatchmakingRequest_Call_GetExpectedResult)
  14. {
  15. AWSGameLiftStopMatchmakingRequest request;
  16. request.m_ticketId = "dummyTicketId";
  17. auto awsRequest = StopMatchmakingActivity::BuildAWSGameLiftStopMatchmakingRequest(request);
  18. EXPECT_TRUE(strcmp(awsRequest.GetTicketId().c_str(), request.m_ticketId.c_str()) == 0);
  19. }
  20. TEST_F(AWSGameLiftStopMatchmakingActivityTest, ValidateStopMatchmakingRequest_CallWithoutTicketId_GetFalseResult)
  21. {
  22. AZ_TEST_START_TRACE_SUPPRESSION;
  23. auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(Multiplayer::StopMatchmakingRequest());
  24. EXPECT_FALSE(result);
  25. AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
  26. }
  27. TEST_F(AWSGameLiftStopMatchmakingActivityTest, ValidateStopMatchmakingRequest_CallWithTicketId_GetTrueResult)
  28. {
  29. AWSGameLiftStopMatchmakingRequest request;
  30. request.m_ticketId = "dummyTicketId";
  31. auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(request);
  32. EXPECT_TRUE(result);
  33. }