Exemplo n.º 1
0
        public async Task ReturnNullIfEntryNotFoundInMemoryStore()
        {
            // Setup the client such that it will claim there is no such party with the given id.
            _database.Setup(db => db.StringGetAsync(_partyKey, CommandFlags.PreferMaster)).ReturnsAsync(RedisValue.Null);

            // Verify that NotFoundException thrown.
            Assert.Null(await _memoryStore.GetAsync <Party>(_party.Id));
        }
Exemplo n.º 2
0
        private static async Task <PartyDataModel> GetPartyByPlayerId(IMemoryStoreClient memClient, string playerId)
        {
            var member = await memClient.GetAsync <Member>(playerId);

            if (member == null)
            {
                return(null);
            }

            return(await memClient.GetAsync <PartyDataModel>(member.PartyId));
        }
        private static async Task <PartyDataModel> GetPartyOfMember(IMemoryStoreClient memClient, string playerId)
        {
            var member = await memClient.GetAsync <Member>(playerId);

            return(member == null ? null : await memClient.GetAsync <PartyDataModel>(member.PartyId));
        }