Ejemplo n.º 1
0
        public async Task ParticipantJoinedInConference_RemoveParticipantAndReturnOldConferenceId()
        {
            const string participantKey        = "2AFA88F3-50E3-4356-9529-F47A730B25B0";
            const string participantId         = "14FAA2C6-8FAC-46D1-B34C-6916F5D213D7";
            const string conferenceKeyTemplate = "conference:7fa3aba5bfdb4a648294fe9fb5df40dc:*";
            const string currentConferenceId   = "50DABA18-7F83-4D0D-8FDD-B2ADE18C5FBC";
            const string currentConferenceKey  = "conference:7fa3aba5bfdb4a648294fe9fb5df40dc:" + currentConferenceId;
            const string currentConnectionId   = "7996bdfaf063485492974d74e7e3d657";

            // arrange
            await _database.SetAsync(participantKey, currentConferenceId);

            await _database.HashSetAsync(currentConferenceKey, participantId, currentConnectionId);

            // act
            var result = await Execute(participantId, participantKey, conferenceKeyTemplate);

            // assert
            var arr = (string[])result;

            Assert.Equal(arr[0], currentConferenceId);
            Assert.Equal(arr[1], currentConnectionId);

            var participantKeyExists = await _database.KeyDeleteAsync(participantKey);

            Assert.False(participantKeyExists);

            var participantMappingExists = await _database.HashExistsAsync(currentConferenceKey, participantId);

            Assert.False(participantMappingExists);
        }
 public async ValueTask RemoveAllDataOfConference(string conferenceId)
 {
     var key = GetKey(conferenceId);
     await _redisDatabase.KeyDeleteAsync(key);
 }
 public async ValueTask RemoveAllConnections(Participant participant)
 {
     var key = GetKey(participant);
     await _database.KeyDeleteAsync(key);
 }
Ejemplo n.º 4
0
 public async ValueTask Remove(string conferenceId, string syncObjId)
 {
     var key = GetKey(conferenceId, syncObjId);
     await _database.KeyDeleteAsync(key);
 }
Ejemplo n.º 5
0
        public async Task <bool> Delete(string conferenceId)
        {
            var key = GetKey(conferenceId);

            return(await _database.KeyDeleteAsync(key));
        }
 public async ValueTask DeletePermissions(Participant participant)
 {
     var redisKey = GetPermissionsKey(participant);
     await _database.KeyDeleteAsync(redisKey);
 }
Ejemplo n.º 7
0
 public async ValueTask ClearQueue(string conferenceId, string roomId)
 {
     var queueKey = GetQueueKey(conferenceId, roomId);
     await _database.KeyDeleteAsync(queueKey);
 }