Example #1
0
 public ConversationsController(IAuthService authService, IConversationsService conversationsService, IMessagesService messagesService, IConversationValidator conversationValidator)
 {
     _authService           = authService;
     _conversationsService  = conversationsService;
     _messagesService       = messagesService;
     _conversationValidator = conversationValidator;
 }
 public MessageController(IMessagesService messages, ISquadsService squads, IUsersService users, IPlatoonsService platoons)
 {
     this.messages = messages;
     this.squads = squads;
     this.platoons = platoons;
     this.users = users;
 }
Example #3
0
 public MessageController
 (
     IMessagesService service
 )
 {
     _service = service;
 }
 public MessagesController(IPlayersService playersService, IRepository <Player> playersRepository, IMessagesService messagesService, UserManager <ApplicationUser> userManager)
 {
     this.playersService    = playersService;
     this.playersRepository = playersRepository;
     this.messagesService   = messagesService;
     this.userManager       = userManager;
 }
Example #5
0
 public UserAuthenticationTokenProvider(ISettings settings, IHttpClientFactory clientFactory, IAuthorizeCodeProvider provider, IMessagesService messagesService)
 {
     _settings        = settings;
     _clientFactory   = clientFactory;
     _provider        = provider;
     _messagesService = messagesService;
 }
Example #6
0
 public ChatController(
     IUsersService usersService,
     IMessagesService messagesService)
 {
     this.usersService    = usersService;
     this.messagesService = messagesService;
 }
Example #7
0
 public IosAppCommand(IMessagesService messagesService,
                      TelegramBotClient telegramBotClient, TelegramBotSettings settings)
 {
     _messagesService   = messagesService;
     _telegramBotClient = telegramBotClient;
     _settings          = settings;
 }
Example #8
0
 public ChatHub(
     IMessagesService messagesService,
     IUsersService usersService)
 {
     this.messagesService = messagesService;
     this.usersService    = usersService;
 }
Example #9
0
 public UserJoinedCommand(IMessagesService messagesService,
                          TelegramBotClient telegramBotClient, IUsersOnChannelRepository usersOnChannelRepository)
 {
     _messagesService          = messagesService;
     _telegramBotClient        = telegramBotClient;
     _usersOnChannelRepository = usersOnChannelRepository;
 }
 public SubscriptionController
 (
     IMessagesService service
 )
 {
     _service = service;
 }
Example #11
0
 public MessageHub(
     IMessagesService messagesService,
     IUserService userService)
 {
     this.messagesService = messagesService;
     this.userService     = userService;
 }
Example #12
0
 public FaqCommand(IMessagesService messagesService,
                   TelegramBotClient telegramBotClient, TelegramBotSettings appSettings)
 {
     _messagesService   = messagesService;
     _telegramBotClient = telegramBotClient;
     _appSettings       = appSettings;
 }
Example #13
0
 public LoginController(IUserService UserService, IMessagesService MessagesService, ISchoolService SchoolService)
     : base()
 {
     this._UserService = UserService;
     this._MessagesService = MessagesService;
     this._SchoolService = SchoolService;
 }
 public ProductAddedHandler(MailKitOptions options, IMessagesService messagesService, IUserService userService, ILogger <ProductAddedHandler> logger)
 {
     _options         = options;
     _messagesService = messagesService;
     _userService     = userService;
     _logger          = logger;
 }
 public MessagesController(
     UserManager <ApplicationUser> userManager,
     IMessagesService messagesService)
 {
     this.userManager     = userManager;
     this.messagesService = messagesService;
 }
Example #16
0
 public void Init()
 {
     this.messageService = TestObjectFactory.GetMessagesService();
     this.controller = new MessagesController(this.messageService);
     this.presenceService = TestObjectFactory.GetPresenceService();
     this.controllerWithPresence = new MessagesController(this.messageService, this.presenceService);
 }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService   = messagesService;
            _missionPlanner    = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn         = new ObservableProperty <bool>(false);
            WeatherReport      = new ObservableProperty <WeatherInfo>();
            SentTelemetry      = new ObservableProperty <Unit>();

            CreateClient((url, apiUrl, state) =>
                         new AltitudeAngelClient(url, apiUrl, state,
                                                 (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                          .MapChanged
                          .Throttle(TimeSpan.FromSeconds(1))
                          .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            try
            {
                var list = JsonConvert.DeserializeObject <List <string> >(_missionPlanner.LoadSetting("AAWings.Filters"));

                FilteredOut.AddRange(list.Distinct());
            } catch
            {
            }

            TryConnect();
        }
Example #18
0
        public async Task AddMessageToDbAsync_WithValidData_ShouldAddMessageToDbCorrectly()
        {
            //Arrange
            var expectedMessage = new Message
            {
                Id                = "MessageId",
                Content           = "MessageContent",
                ApplicationUserId = "UserId",
                GameId            = "GameId",
            };

            var moqUsersService = new Mock <IUsersService>();

            moqUsersService.Setup(x => x.GetCurrentUserAsync()).ReturnsAsync(new ApplicationUser {
                Id = "UserId"
            });

            var option = new DbContextOptionsBuilder <ChessDbContext>()
                         .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options;
            var db = new ChessDbContext(option);

            this.messagesService = new MessagesService(db, mapper, moqUsersService.Object);

            //Act
            await this.messagesService.AddMessageToDbAsync("MessageContent", "GameId");

            var resultMessage = await db.Messages.FirstOrDefaultAsync(x => x.Content == "MessageContent" && x.GameId == "GameId");

            //Assert
            Assert.Equal(expectedMessage.Content, resultMessage.Content);
            Assert.Equal(expectedMessage.GameId, resultMessage.GameId);
            Assert.Equal(expectedMessage.ApplicationUserId, resultMessage.ApplicationUserId);
        }
Example #19
0
 public DashboardController(
     ISettingsService settingsService,
     IMessagesService messagesService)
 {
     this.settingsService = settingsService;
     this.messagesService = messagesService;
 }
Example #20
0
        public MessagesViewModel(IMessagesService messagesService)
        {
            Messages = new ObservableCollection <string>();

            messagesService.Messages
            .Subscribe(message => Messages.Add(message.Content));
        }
Example #21
0
 public ChatHub(
     UserManager <ApplicationUser> userManager,
     IMessagesService messagesService)
 {
     this.userManager     = userManager;
     this.messagesService = messagesService;
 }
Example #22
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActivityInstance = this;
            progress         = new ProgressDialogHelper(this);
            signInService    = new SignInService();
            bitmapService    = new BitmapOperationService();
            appSettings      = SharedPreferencesHelper.GetAppSettings(this);
            if (!appSettings.ChatDisabled)
            {
                this.chatHubClientService = ChatHubClientService.GetServiceInstance(bearerToken);
            }
            this.messagesService = new MessagesService(bearerToken);
            SetContentView(Resource.Layout.ConversationActivity);
            SetupViews(savedInstanceState);
            SetupConversationToolbar();
            pageNumber = 0;
            GetExtras();
            player = new MediaPlayer();
            player.SetDataSource(this, Android.Net.Uri.Parse("android.resource://" + this.PackageName + "/raw/" + Resource.Raw.message_sound));
            player.Prepare();
            progress.ShowProgressDialog("Trwa pobieranie wiadomoœci...");
            await SetupIntelocutorInfo();
            await GetAndDisplayMesages(savedInstanceState);

            coversationsLayoutWrapper.Visibility = ViewStates.Visible;
            progress.CloseProgressDialog();
        }
 public LoginViewModel(INavigationService navService, IAuthService authService
                       , IMessagesService messagesService)
 {
     _navigationService = navService;
     _authService       = authService;
     _messagesService   = messagesService;
 }
Example #24
0
        public FlightService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            ISettings settings,
            IFlightDataService flightDataService,
            IAltitudeAngelClient client,
            IOutboundNotifsService notificationsService)
        {
            _messagesService                = messagesService;
            _missionPlanner                 = missionPlanner;
            _settings                       = settings;
            _client                         = client;
            _notificationsService           = notificationsService;
            _settings.CurrentFlightReportId = null;
            _settings.CurrentFlightId       = null;

            if (_settings.SurveillanceMode)
            {
                _disposer.Add(flightDataService.FlightArmed
                              .SubscribeWithAsync(async(i, ct) => await StartSurveillanceFlight(await _missionPlanner.GetFlightPlan())));
            }
            else
            {
                _disposer.Add(flightDataService.FlightArmed
                              .SubscribeWithAsync(async(i, ct) => await StartTelemetryFlight(await _missionPlanner.GetFlightPlan())));
                _disposer.Add(flightDataService.FlightDisarmed
                              .SubscribeWithAsync((i, ct) => CompleteFlight()));
            }
        }
Example #25
0
        public async Task GetMessageDetailsViewModelsAsync_WithCurrentUserNotParticipantInConversation_ShouldThrowAnInvalidOperationException()
        {
            //Arrange
            var expectedErrorMessage = "You are not participant in this conversation!";

            var moqAdsService   = new Mock <IAdsService>();
            var moqUsersService = new Mock <IUsersService>();

            moqUsersService.Setup(x => x.GetCurrentUserId())
            .Returns("FakeUserId");
            var moqIMapper = new Mock <IMapper>();
            var context    = InitializeContext.CreateContextForInMemory();

            var testingAd = CreateTestingAd();
            await context.AddAsync(testingAd);

            await context.SaveChangesAsync();

            messagesService = new MessagesService(context, moqAdsService.Object, moqUsersService.Object, moqIMapper.Object);

            //Act and assert
            var ex = await Assert.ThrowsAsync <InvalidOperationException>(() =>
                                                                          messagesService.GetMessageDetailsViewModelsAsync(1, "SenderId", "RecipientId"));

            Assert.Equal(expectedErrorMessage, ex.Message);
        }
Example #26
0
 public MessagesController(IMessagesService service, ITopicsService topicService, IUsersService userService, ITopicsSubscriptionsService topicSubscriptionService)
 {
     _service = service;
     _topicService = topicService;
     _topicSubscriptionService = topicSubscriptionService;
     _userService = userService;
 }
        public async Task GetMessagesForOfferAsync_WithValidData_ShouldReturnMessages()
        {
            var expected = 2;
            var guid1    = Guid.NewGuid().ToString();
            var guid2    = Guid.NewGuid().ToString();

            var moqHttpContextAccessor = new Mock <IHttpContextAccessor>();

            var moqCategoriesService = new Mock <ICategoryService>();
            var moqCloudinaryService = new Mock <ICloudinaryService>();
            var moqOfferService      = new Mock <IOfferService>();

            var context = InitializeContext.CreateContextForInMemory();

            this.userService     = new UserService(context, moqHttpContextAccessor.Object);
            this.messagesService = new MessagesService(context, this.userService, moqOfferService.Object);

            var sender = new ApplicationUser()
            {
                Id       = guid1,
                UserName = "******",
            };

            var reciver = new ApplicationUser()
            {
                Id       = guid2,
                UserName = "******",
            };

            var createOfferInputModel = new CreateOfferModel()
            {
                Name         = "Wow Account",
                CategotyName = "Wow",
                CreatorId    = guid2,
                Description  = "Some Test Description",
                Price        = 10.00,
                PicUrl       = "link",
            };

            this.offerService = new OfferService(context, moqCategoriesService.Object, moqCloudinaryService.Object);

            var offer = await this.offerService.CreateOfferAsync(createOfferInputModel);

            await this.offerService.ApproveOfferAsync(offer.Id);

            context.Users.Add(sender);
            context.Users.Add(reciver);
            await context.SaveChangesAsync();

            // Assert

            await this.messagesService.CreateMessageAsync(guid1, guid2, offer.Id, "TestMessage");

            await this.messagesService.CreateMessageAsync(guid1, guid2, offer.Id, "TestMessage2");

            var unreadMessages = await this.messagesService.GetMessagesForOfferAsync(offer.Id, guid1, guid2);

            Assert.Equal(expected, unreadMessages.Count);
        }
 public MessagesController(IHttpContextAccessor accessor, IRecaptchaService recaptchaService,
                           IMessagesService messagesService, IMapper mapper)
 {
     _accessor         = accessor;
     _recaptchaService = recaptchaService;
     _messagesService  = messagesService;
     _mapper           = mapper;
 }
Example #29
0
 public OrderCreatedHandler(MailKitOptions options,
                            ICustomersService customersService,
                            IMessagesService messageServices)
 {
     _options          = options;
     _customersService = customersService;
     _messageService   = messageServices;
 }
        public MessagesViewModel(IMessagesService messagesService)
        {
            Messages = new ObservableCollection<string>();

            messagesService.Messages
                            .ObserveOnDispatcher()
                            .Subscribe(message => Messages.Add(message.Content));
        }
Example #31
0
 /// <summary>
 /// Constructor of home controller
 /// </summary>
 /// <param name="configuration">Configuration of application. <see cref="ApplicationConfiguration"/></param>
 /// <param name="logger">Logger</param>
 /// <param name="userInfoService">Service returning user information</param>
 /// <param name="messagesService">messages service responsible for operation related to messages - injected by framework</param>
 /// <param name="serviceManager">manager responsible for wrapping of individual service call to UI output format - injected by framework</param>
 public HomeController(ApplicationConfiguration configuration, ILogger <HomeController> logger, IUserInfoService userInfoService, IMessagesService messagesService, IServiceManager serviceManager, IOptions <MapDNSes> mapDNSes) : base(configuration, logger)
 {
     this.configuration   = configuration;
     this.userInfoService = userInfoService;
     this.messagesService = messagesService;
     this.serviceManager  = serviceManager;
     this.mapDNSes        = mapDNSes.Value;
 }
 public MessagesController(
     IMessagesService messagesService,
     ILogger <MessagesController> logger,
     IMapper mapper)
     : base(logger, mapper)
 {
     this.messagesService = messagesService;
 }
Example #33
0
 public RecycleBinViewModel(INavigationService navigationService, ILocalFileService localFileService,
                            ICloudFileService cloudFileService, IMessagesService messagesService)
 {
     _navigationService = navigationService;
     _localFileService  = localFileService;
     _cloudFileService  = cloudFileService;
     _messagesService   = messagesService;
 }
Example #34
0
 public HomeController(ILogger <HomeController> logger, IInstitutionsService institutionsService, IDonationsService donationsService, IMessagesService messagesService, IConfiguration configuration)
 {
     _logger              = logger;
     _configuration       = configuration;
     _institutionsService = institutionsService;
     _donationsService    = donationsService;
     _messagesService     = messagesService;
 }
Example #35
0
        public async Task GetUnreadMessagesCountAsync_WithValidData_ShouldReturnCorrectResult()
        {
            //Arrange
            var expected = 2;

            var moqAdsService   = new Mock <IAdsService>();
            var moqUsersService = new Mock <IUsersService>();
            var moqIMapper      = new Mock <IMapper>();
            var context         = InitializeContext.CreateContextForInMemory();

            messagesService = new MessagesService(context, moqAdsService.Object, moqUsersService.Object, moqIMapper.Object);

            var messages = new List <Message>
            {
                new Message
                {
                    AdId        = 1,
                    SenderId    = "SenderId",
                    RecipientId = "RecipientId",
                    Content     = "Content1",
                    IsRead      = false
                },
                new Message
                {
                    AdId        = 1,
                    SenderId    = "SenderId",
                    RecipientId = "RecipientId",
                    Content     = "Content2",
                    IsRead      = false
                },
                new Message
                {
                    AdId        = 1,
                    SenderId    = "SenderId",
                    RecipientId = "FakeRecipientId",
                    Content     = "Content3",
                    IsRead      = false
                },
                new Message
                {
                    AdId        = 1,
                    SenderId    = "SenderId",
                    RecipientId = "RecipientId",
                    Content     = "Content3",
                    IsRead      = true
                }
            };

            await context.Messages.AddRangeAsync(messages);

            await context.SaveChangesAsync();

            //Act
            var actual = await messagesService.GetUnreadMessagesCountAsync("RecipientId");

            //Assert
            Assert.Equal(expected, actual);
        }
 public UsersAdministrationController(
     ITownsService towns,
     UserManager<ApplicationUser> manager,
     IAdvertisementsService advertisements,
     ICommentsService comments,
     IMessagesService messages)
 {
     this.towns = towns;
     this.manager = manager;
     this.messages = messages;
     this.advertisements = advertisements;
     this.comments = comments;
 }
Example #37
0
 public HomeController(
     IDiplomasService diplomas,
     ITeachersService teachers,
     IStudentsService students,
     IMessagesService messages,
     ITagsService tags)
 {
     this.diplomas = diplomas;
     this.teachers = teachers;
     this.students = students;
     this.messages = messages;
     this.tags = tags;
 }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            _disposer.Add(_missionPlanner.FlightPlanningMap
              .MapChanged
              .Throttle(TimeSpan.FromSeconds(1))
              .Subscribe(i => UpdateMapData(_missionPlanner.FlightPlanningMap)));

            try
            {
                var list = JsonConvert.DeserializeObject<List<string>>(_missionPlanner.LoadSetting("AAWings.Filters"));

                FilteredOut.AddRange(list.Distinct());
            } catch
            {

            }

            TryConnect();
        }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            TryConnect();
        }
Example #40
0
 public MessageHandler()
 {
     Type serviceType = Type.GetType(Pesta.Utilities.PestaSettings.DbServiceName);
     service = serviceType.GetField("Instance", BindingFlags.Static | BindingFlags.Public).GetValue(null) as IMessagesService;
 }
		public AdvertisementItemDetailsActivity() {
			this.advertisementItemService = new AdvertisementItemService();
			this.bitmapOperationService = new BitmapOperationService();
			messagesService = new MessagesService();
		}
Example #42
0
 public void Initialize()
 {
     this.messageRepository = RepositoriesTestObjectFactory.GetMessageRepository();
     this.userRepository = RepositoriesTestObjectFactory.GetUsersRepository();
     this.messageService = new MessagesService(this.messageRepository, this.userRepository);
 }
		public ConversationActivity()
		{
			this.messagesService = new MessagesService();
		}
Example #44
0
 public MessagesController(IMessagesService messagesService, IBus bus)
 {
     _messagesService = messagesService;
     _bus = bus;
 }
Example #45
0
 public MessagesController(IMessagesService messageServicePassed, IPresenceService presenceServicePassed)
     : this(messageServicePassed)
 {
     this.presences = presenceServicePassed;
 }
 public UsersController(IUsersService usersService, IMessagesService messagesService)
 {
     this.users = usersService;
     this.messages = messagesService;
 }
 public MessagesAdministrationController(IMessagesService messages)
 {
     this.messages = messages;
 }
 public ProfileController(IMessagesService messages, IUsersService users)
 {
     this.messages = messages;
     this.users = users;
 }
 public MessageController(IMessagesService messageService)
 {
     this.messageService = messageService;
 }
Example #50
0
 public MessagesController(IMessagesService messageServicePassed)
 {
     this.messages = messageServicePassed;
 }
 public MessagesController(IMessagesService messagesService, IUsersService usersService, ICacheService cacheService)
 {
     this.messages = messagesService;
     this.users = usersService;
     this.Cache = cacheService;
 }
 public MessagesController(UserManager<ApplicationUser> manager, IAdvertisementsService advertisements, IMessagesService messages)
 {
     this.manager = manager;
     this.advertisements = advertisements;
     this.messages = messages;
 }