@@ -55,6 +55,29 @@ public async Task TestThatGameLiftCanAllocate()
5555 Assert . That ( allocation . AllocationData [ "placementId" ] , Is . EqualTo ( "placementId" ) ) ;
5656 }
5757
58+ [ Test ]
59+ public async Task TestThatGameLiftDefaultsRegionWhenEmptyString ( )
60+ {
61+ _gameLiftMock . Reset ( ) ;
62+ _gameLiftMock . Setup ( g => g . StartGameSessionPlacementAsync ( It . IsAny < StartGameSessionPlacementRequest > ( ) , CancellationToken . None ) )
63+ . ReturnsAsync ( new StartGameSessionPlacementResponse
64+ {
65+ GameSessionPlacement = new GameSessionPlacement
66+ {
67+ PlacementId = "placementId" ,
68+ }
69+ } ) ;
70+
71+ var allocation = await _allocator . Allocate ( _executionContextMock . Object , new AllocateRequest ( "1234" ,
72+ new MatchmakingResults ( null , "matchId" , "poolId" , "poolName" , "queueName" , new
73+ Dictionary < string , object > {
74+ { "Region" , "" } ,
75+ } ) ) ) ;
76+
77+ Assert . That ( allocation . AllocationData , Is . Not . Null ) ;
78+ Assert . That ( allocation . AllocationData [ "awsRegion" ] , Is . EqualTo ( "eu-west-2" ) ) ;
79+ }
80+
5881 [ Test ]
5982 public async Task TestThatGameLiftCanAllocateToRegions ( )
6083 {
@@ -71,7 +94,7 @@ public async Task TestThatGameLiftCanAllocateToRegions()
7194 var allocation = await _allocator . Allocate ( _executionContextMock . Object , new AllocateRequest ( "1234" ,
7295 new MatchmakingResults ( null , "matchId" , "poolId" , "poolName" , "queueName" , new
7396 Dictionary < string , object > {
74- { "region " , "customRegion" } ,
97+ { "Region " , "customRegion" } ,
7598 } ) ) ) ;
7699
77100 Assert . That ( allocation . AllocationData , Is . Not . Null ) ;
0 commit comments