public MessagesService(ResponsesService responsesService, MessageSplittingService splittingService, EmbedMessageSplittingService embedMessageSplittingService, ResponsesCachingService responsesCachingService) { this._responsesService = responsesService; this._splittingService = splittingService; this._embedMessageSplittingService = embedMessageSplittingService; this._responsesCachingService = responsesCachingService; }
public HelpService(MessagesServiceFactory messagesServiceFactory, HelpMessageGeneratorService messageGeneratorService, ResponsesService responsesService, IQueryBus queryBus) { this._messagesServiceFactory = messagesServiceFactory; this._helpMessageGenerator = messageGeneratorService; this._responsesService = responsesService; this._queryBus = queryBus; }
public MessagesService(ResponsesService responsesService, MessageSplittingService splittingService, EmbedMessagesService embedMessagesService) { this._responsesService = responsesService; this._splittingService = splittingService; this._embedMessagesService = embedMessagesService; this.ReloadCache().Wait(); }
public DirectMessagesService(ResponsesService responsesService, MessageSplittingService messageSplittingService, EmbedMessagesService embedMessagesService, EmbedMessageSplittingService embedMessageSplittingService) { this._responsesService = responsesService; this._messageSplittingService = messageSplittingService; this._embedMessagesService = embedMessagesService; this._embedMessageSplittingService = embedMessageSplittingService; }
public UsersController(IQueryBus queryBus, MessagesServiceFactory messagesServiceFactory, RolesService rolesService, UsersService usersService, ResponsesService responsesService) { this._queryBus = queryBus; this._messagesServiceFactory = messagesServiceFactory; this._rolesService = rolesService; this._usersService = usersService; this._responsesService = responsesService; }
public HelpController(MessagesServiceFactory messagesServiceFactory, HelpMessageGeneratorService messageGeneratorService, ResponsesService responsesService, HelpService helpService) { this._messagesServiceFactory = messagesServiceFactory; this._helpMessageGenerator = messageGeneratorService; this._responsesService = responsesService; this._helpService = helpService; }
public MessagesService(ResponsesService responsesService, MessageSplittingService splittingService, EmbedMessageSplittingService embedMessageSplittingService) { this._responsesService = responsesService; this._splittingService = splittingService; this._embedMessageSplittingService = embedMessageSplittingService; if (!_serversResponses.Any()) { this.Refresh().Wait(); } }
public void Setup() { _fixture = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true }); _responsesRepositoryMock = _fixture.Freeze <Mock <IResponsesRepository> >(); _eventDispatcherMock = _fixture.Freeze <Mock <IEventDispatcher> >(); _service = _fixture.Create <ResponsesService>(); }
public async Task TestCreateExerciseAsync_WithValidData_ShouldCreateExerciseCorrectly() { var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var repository = new EfDeletableEntityRepository <Response>(context); var service = new ResponsesService(repository); await service.CreateResponseAsync("Some Content", "111", "222", "333"); var expected = "Some Content"; var targetResponse = repository.All().Where(c => c.Content == expected).FirstOrDefault(); Assert.Equal(expected, targetResponse.Content); }
public static ResponsesService SetGetResponsesFromDatabase(this ResponsesService service, IQueryBus queryBus) { service.GetResponsesFunc = contexts => { var responsesInBase = queryBus.Execute(new GetResponsesQuery()).Responses; var serverResponses = responsesInBase.Where(x => x.ServerId == contexts.Server.Id); var mapped = serverResponses.Select(x => new Response { OnEvent = x.OnEvent, Message = x.Message }); return(mapped); }; return(service); }
public async Task TestDeleteCommentAsync_WithInvalidData_ShouldThrowError() { var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var repository = new EfDeletableEntityRepository <Response>(context); var responsetId = "asdf"; await repository.AddAsync(new Response { Id = responsetId }); await repository.SaveChangesAsync(); var service = new ResponsesService(repository); var invalidId = "aaaa"; await Assert.ThrowsAsync <ArgumentNullException>(async() => { await service.DeleteResponseAsync(invalidId); }); }
public async Task TestDeleteCommentAsync_WithValidData_ShouldCreateExerciseCorrectly() { var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var repository = new EfDeletableEntityRepository <Response>(context); var responseId = "asdf"; await repository.AddAsync(new Response { Id = responseId }); await repository.SaveChangesAsync(); var service = new ResponsesService(repository); await service.DeleteResponseAsync(responseId); var deletedComment = repository.AllWithDeleted().Where(c => c.Id == responseId).FirstOrDefault(); Assert.True(deletedComment.IsDeleted); }
public static ResponsesService SetGetResponsesFromDatabase(this ResponsesService service, IQueryBus queryBus) { service.GetResponsesFunc = contexts => { var responsesInBase = queryBus.Execute(new GetResponsesQuery()).Responses; var serverResponses = responsesInBase.Where(x => x.ServerId == contexts.Server.Id); var overridedOnEvents = serverResponses.Select(x => x.OnEvent).ToList(); var responsesNotOverridedByServer = responsesInBase.Where(x => !overridedOnEvents.Contains(x.OnEvent)).ToList(); responsesNotOverridedByServer.AddRange(serverResponses); var mapped = responsesNotOverridedByServer.Select(x => new Response { OnEvent = x.OnEvent, Message = x.Message }); return(mapped); }; return(service); }
public ResponsesController(ResponsesService rs) { _rs = rs; }
public CustomCommandsController(IQueryBus queryBus, MessagesServiceFactory messagesServiceFactory, ResponsesService responsesService) { this._queryBus = queryBus; this._messagesServiceFactory = messagesServiceFactory; this._responsesService = responsesService; }
public DirectMessagesService(ResponsesService responsesService, MessageSplittingService messageSplittingService) { this._responsesService = responsesService; _messageSplittingService = messageSplittingService; }
public HelpExampleUsageGenerator(ResponsesService responsesService) { this._responsesService = responsesService; }
public QuestionsController(QuestionsService qs, ResponsesService rs) { _qs = qs; _rs = rs; }
public QuestionsController(QuestionsService qs, ResponsesService rs, CategoriesService cs) { _qs = qs; _rs = rs; _cs = cs; }
public HelpMessageGeneratorService(ResponsesService responsesService, HelpExampleUsageGenerator helpExampleUsageGenerator) { this._responsesService = responsesService; this._helpExampleUsageGenerator = helpExampleUsageGenerator; }
public MessagesServiceFactory(ResponsesService responsesService, MessageSplittingService splittingService) { this._responsesService = responsesService; _splittingService = splittingService; }
public ResponsesController(ResponsesService service, UserManager <IdentityUser> userManager) { _service = service; _userManager = userManager; }