public async Task <IActionResult> GetAsync([FromRoute] DeleteSearchCommand command, CancellationToken cancellationToken)
        {
            _logger.LogInformation($"Administrator delete search {command.Id } ");
            var result = await _mediator.Send(command, cancellationToken);

            return(Ok(result));
        }
        public async void DeleteSearchCommandHandler_should_delete_search()
        {
            // Arrange
            A.CallTo(() => _mongoDBService.RemoveAsync(A <string> .Ignored)).Returns(1);
            var command = new DeleteSearchCommand
            {
                Id = "1254785369874"
            };

            // Act
            var result = await _deleteSearchCommandHandler.Handle(command, default);

            // Assert
            A.CallTo(() => _mongoDBService.RemoveAsync(A <string> .Ignored)).MustHaveHappenedOnceExactly();
            Assert.Equal(1, result);
        }
Ejemplo n.º 3
0
        public RequestForQuoteFunctionsViewModel(IEventAggregator eventAggregator, IClientManager clientManager,
                                                 IUnderlyingManager underlyingManager, IBookManager bookManager, ISearchManager searchManager,
                                                 IConfigurationManager configManager, IUserManager userManager, IGroupManager groupManager)
        {
            if (eventAggregator == null)
            {
                throw new ArgumentNullException("eventAggregator");
            }

            if (clientManager == null)
            {
                throw new ArgumentNullException("clientManager");
            }

            if (underlyingManager == null)
            {
                throw new ArgumentNullException("underlyingManager");
            }

            if (bookManager == null)
            {
                throw new ArgumentNullException("bookManager");
            }

            if (searchManager == null)
            {
                throw new ArgumentNullException("searchManager");
            }

            if (configManager == null)
            {
                throw new ArgumentNullException("configManager");
            }

            if (userManager == null)
            {
                throw new ArgumentNullException("userManager");
            }

            if (groupManager == null)
            {
                throw new ArgumentNullException("groupManager");
            }

            SearchRequestsCommand = new SearchRequestsCommand(this);
            FilterRequestsCommand = new FilterRequestsCommand(this);
            ClearCriteriaCommand  = new ClearCriteriaCommand(this);
            SaveSearchCommand     = new SaveSearchCommand(this);
            DeleteSearchCommand   = new DeleteSearchCommand(this);
            UpdatePrivacyCommand  = new UpdatePrivacyCommand(this);

            this.clientManager     = clientManager;
            this.underlyingManager = underlyingManager;
            this.bookManager       = bookManager;
            this.searchManager     = searchManager;
            this.eventAggregator   = eventAggregator;
            this.configManager     = configManager;
            this.userManager       = userManager;
            this.groupManager      = groupManager;

            InitializeCollections();
            InitializeEventSubscriptions();
        }