예제 #1
0
 public GetUserLevelImageQueryHandler(IApplicationDbContext context,
                                      IXpCalculatorService xpCalculator,
                                      IMediator mediator)
 {
     _context      = context;
     _xpCalculator = xpCalculator;
     _mediator     = mediator;
 }
 public AddXpToUserCommandHandler(IApplicationDbContext context,
                                  IDomainEventService provider,
                                  IXpCalculatorService calculator)
 {
     _context    = context;
     _calculator = calculator;
     _provider   = provider;
 }
 public void Setup()
 {
     _appFixture = new ApplicationFixture();
     _calculator = Substitute.For <IXpCalculatorService>();
     _dbContext  = Substitute.For <IApplicationDbContext>();
     _appFixture.OnConfigureServices += (_, services) =>
     {
         var service = services
                       .First(descriptor => descriptor.ServiceType == typeof(IXpCalculatorService));
         services.Remove(service);
         services.AddSingleton(_calculator);
         services.AddSingleton(_dbContext);
     };
 }