public Task <Player> MockPlayerExists(TestPlayerDto player)
        {
            var p = new Player(CurrentTenant, player.Version,
                               player.Id, player.FirstName, player.LastName);

            _repoMock.Get(CurrentTenant, player.Id)
            .Returns(p);

            return(Task.FromResult(p));
        }
Beispiel #2
0
 public override EntityId GetEntityId(object instance)
 {
     return(instance switch
     {
         (TenantId t, PlayerId p) => GetIdForPlayer(t, p),
         Player p => GetIdForPlayer(p.Tenant, p.Id),
         PlayerDto dto => GetIdForPlayer(dto.Tenant, dto.Id),
         TestPlayerDto test => GetIdForPlayer(base.CurrentTenant, test.Id),
         PlayerCreated pce => GetIdForPlayer(pce.TenantId, pce.PlayerId),
         PlayerNameCorrected pnce => GetIdForPlayer(pnce.TenantId, pnce.PlayerId),
         CorrectName.Request cnr => GetIdForPlayer(base.CurrentTenant, cnr.PlayerId),
         _ => null
     });