Exemple #1
0
 public MessageService(IMessageRepository messageRepository, IUserRepository usersRepository, IMessageStateRepository messageStateRepository, NotificationService notificationRepository)
 {
     _messageRepository      = messageRepository;
     _usersRepository        = usersRepository;
     _messageStateRepository = messageStateRepository;
     _notificationRepository = notificationRepository;
 }
Exemple #2
0
        public static Message CreateValidMessage(
            User user,
            MessageStateEnum stateEnum = MessageStateEnum.Published,
            string mind              = "Fake message.",
            string speech            = "",
            int amountOfFavourites   = 0,
            DateTime?creationDate    = null,
            Message quotedMessage    = null,
            Message commentedMessage = null)
        {
            IMessageStateRepository messageStateRepository = ServiceLocator.Current.GetInstance <IMessageStateRepository>();
            ILanguageRepository     laguageRepository      = ServiceLocator.Current.GetInstance <ILanguageRepository>();
            Language language = laguageRepository.FindByCode("PL");

            return(new Message
            {
                Id = Guid.NewGuid(),
                User = user,
                Mind = mind,
                MessageState = messageStateRepository.FindByEnum(stateEnum),
                AmountOfFavourites = amountOfFavourites,
                CreationDate = creationDate ?? DateTime.UtcNow,
                QuotedMessage = quotedMessage,
                CommentedMessage = commentedMessage,
                Speech = speech,
                Language = language
            });
        }
 /// <inheritdoc />
 public NullRepositoryContext()
 {
     _messageRepository = new NullMessageRepository();
     _messageBrokerServiceRepository = new NullMessageBrokerServiceRepository();
     _messageStateRepository         = new NullMessageStateRepository();
     _subscriberRepository           = new NullSubscriberRepository();
 }
Exemple #4
0
 public MessageService(
     IMessageRepository messageRepository,
     IMessageStateRepository messageStateRepository,
     IUserRepository userRepository,
     IMessageUrlService messageUrlService,
     IFileRepository fileRepository,
     IDatabaseTransactionService databaseTransactionService)
 {
     _messageRepository          = messageRepository;
     _messageStateRepository     = messageStateRepository;
     _userRepository             = userRepository;
     _messageUrlService          = messageUrlService;
     _fileRepository             = fileRepository;
     _databaseTransactionService = databaseTransactionService;
 }
Exemple #5
0
 public MessageStateService(IMessageStateRepository messageStateRepository)
 {
     _messageStateRepository = messageStateRepository;
 }
Exemple #6
0
 public NullMessageStateRepositoryTests()
 {
     _repositoryContext = new NullRepositoryContextFactory().Get();
     _cut = _repositoryContext.MessageStateRepository;
 }