Exemple #1
0
        public DancerModule(IDancerService dancerService, IMapper mapper)
            : base("/dancer")
        {
            this.mapper        = mapper;
            this.dancerService = dancerService ?? throw new ArgumentNullException(nameof(dancerService));

            Get("/dancers", args => AllDancers());

            Get("/{Id}", async x => await GetDancer(x.Id));
        }
        public DancersControllerTests(PostgresDatabaseFixture fixture)
        {
            _fixture = fixture;

            _logger               = new Logger <DancersController>(new NullLoggerFactory());
            _coreService          = new DbCoreData(_fixture._context);
            _dancerService        = new DancerService(_fixture._context);
            _badgeService         = new DbBadge(_fixture._context);
            _fileStorage          = new LocalFileStorage(".");
            _authorizationService = Substitute.For <IAuthorization>();

            _dancersController = new DancersController(
                _logger,
                _coreService,
                _dancerService,
                _badgeService,
                _fileStorage,
                _authorizationService);

            Setup.DropAllRows(_fixture._context);
        }
Exemple #3
0
 public DancersController(IDancerService userService, IMapper mapper)
 {
     this.userService = userService;
     this.mapper      = mapper;
 }