public async Task GetSearchesReturnsAllSearches()
        {
            var options = new DbContextOptionsBuilder <SearchesDbContext>()
                          .UseSqlServer("Data Source=LAPTOP-U3V1724K;Initial Catalog=Microservices.Search.Database;Integrated Security=True")
                          .Options;
            var dbContext = new SearchesDbContext(options);

            var searchProfile = new SearchProfile();
            var configuration = new MapperConfiguration(cfg => cfg.AddProfile(searchProfile));
            var mapper        = new Mapper(configuration);

            var searchService = new SearchService(dbContext, mapper);

            var search = await searchService.GetAllSearchesAsync();

            Assert.True(search.IsSuccess);
            Assert.Null(search.ErrorMessage);
        }
 public PostOrderEventHandler(SearchesDbContext searchesDbContext)
 {
     this.searchesDbContext = searchesDbContext;
 }
Esempio n. 3
0
 public PostProductEventHandler(SearchesDbContext searchesDbContext)
 {
     this.searchesDbContext = searchesDbContext;
 }
 public SearchService(SearchesDbContext searchesDbContext, IMapper mapper)
 {
     this.searchesDbContext = searchesDbContext;
     this.mapper            = mapper;
 }