コード例 #1
0
        public void GivenSeveralUserConnectedWhenGetUserIdOfSessionThenReturnUserIdOfThisSession()
        {
            _repository.Save(new SessionProjection(SessionId, UserId, SessionState.Enabled));
            _repository.Save(new SessionProjection(SessionId.Generate(), new UserId("*****@*****.**"), SessionState.Enabled));

            Check.That(_repository.GetUserIdOfSession(SessionId)).IsEqualTo(UserId);
        }
コード例 #2
0
        public void StoreSession(AxolotlAddress address, SessionRecord record)
        {
            DeleteSession(address);

            SessionsRepository sessionsRepository = new SessionsRepository();
            Sessions           session            = new Sessions()
            {
                RecipientId = address.GetName(),
                DeviceId    = address.GetDeviceId(),
                Record      = record.Serialize()
            };

            sessionsRepository.Save(session);
        }