コード例 #1
0
        public EntitiesController(
            IIlaroAdmin admin,
            Notificator notificator,
            IRecordsService recordsService,
            IConfiguration configuration)
        {
            if (admin == null)
            {
                throw new ArgumentNullException(nameof(admin));
            }
            if (notificator == null)
            {
                throw new ArgumentNullException(nameof(notificator));
            }
            if (recordsService == null)
            {
                throw new ArgumentException(nameof(recordsService));
            }
            if (configuration == null)
            {
                throw new ArgumentException(nameof(configuration));
            }

            _admin          = admin;
            _notificator    = notificator;
            _recordsService = recordsService;
            _configuration  = configuration;
        }
コード例 #2
0
 public RecordsServiceTests()
 {
     this.optionsBuilder = new DbContextOptionsBuilder <ApplicationDbContext>()
                           .UseInMemoryDatabase("recordsDatabase");
     this.db         = new ApplicationDbContext(this.optionsBuilder.Options);
     this.recService = new RecordsService(this.db);
 }
コード例 #3
0
 public RecordsController(
     IRecordsService recordsService,
     IWalletsService walletsService,
     UserManager <ApplicationUser> userManager)
 {
     this.recordsService = recordsService;
     this.walletsService = walletsService;
     this.userManager    = userManager;
 }
コード例 #4
0
 public WalletsController(
     IWalletsService walletsService,
     IRecordsService recordsService,
     ICurrenciesService currenciesService,
     UserManager <ApplicationUser> userManager)
 {
     this.walletsService    = walletsService;
     this.recordsService    = recordsService;
     this.currenciesService = currenciesService;
     this.userManager       = userManager;
 }
コード例 #5
0
        public RecordsServiceTests()
        {
            DbContextOptionsBuilder <ApplicationDbContext> options =
                new DbContextOptionsBuilder <ApplicationDbContext>()
                .UseInMemoryDatabase(Guid.NewGuid().ToString());

            this.applicationDbContext = new ApplicationDbContext(options.Options);
            this.recordsRepository    = new EfDeletableEntityRepository <PugnaFighting.Data.Models.Record>(this.applicationDbContext);
            this.fightsRepository     = new EfDeletableEntityRepository <Fight>(this.applicationDbContext);
            this.recordsService       = new RecordsService(this.recordsRepository, this.fightsRepository);
        }
コード例 #6
0
 public ClusteringController(
     IRecordsService service,
     IMapper mapper,
     IClusteringService clusteringService,
     ITranslateService translateService)
 {
     this.service            = service;
     this.mapper             = mapper;
     this._clusteringService = clusteringService;
     this._translateService  = translateService;
 }
コード例 #7
0
 public RecordsController(
     IRecordsService recordsService
     , UserManager <User> userManager
     , ILogger <RecordsController> logger
     , IMapper mapper)
 {
     _recordsService = recordsService;
     _userManager    = userManager;
     _logger         = logger;
     _mapper         = mapper;
 }
コード例 #8
0
 public WalletsService(
     ApplicationDbContext dbContext,
     IRecordsService recordsService,
     ICurrenciesService currenciesService,
     ICategoriesService categoriesService)
 {
     this.dbContext         = dbContext;
     this.recordsService    = recordsService;
     this.currenciesService = currenciesService;
     this.categoriesService = categoriesService;
 }
 public WalletsControllerTests()
 {
     this.optionsBuilder = new DbContextOptionsBuilder <ApplicationDbContext>()
                           .UseInMemoryDatabase("walletsDatabase");
     this.db                = new ApplicationDbContext(this.optionsBuilder.Options);
     this.recordsService    = new RecordsService(this.db);
     this.currenciesService = new CurrenciesService(this.db);
     this.categoriesService = new CategoriesService(this.db, this.recordsService);
     this.walletsService    = new WalletsService(this.db, this.recordsService, this.currenciesService, this.categoriesService);
     this.userManager       = new FakeUserManager();
     this.controller        = new WalletsController(this.walletsService, this.recordsService, this.currenciesService, this.userManager);
 }
コード例 #10
0
ファイル: GroupController.cs プロジェクト: rgonek/Ilaro.Admin
        public GroupController(
            IIlaroAdmin admin, 
            Notificator notificator, 
            IRecordsService recordsService)
        {
            if (admin == null)
                throw new ArgumentNullException(nameof(admin));
            if (notificator == null)
                throw new ArgumentNullException(nameof(notificator));
            if (recordsService == null)
                throw new ArgumentNullException(nameof(recordsService));

            _admin = admin;
            _notificator = notificator;
            _recordsService = recordsService;
        }
コード例 #11
0
        public RecordsServiceTests()
        {
            var testdata = new List <Person>();

            testdata.Add(new Person()
            {
                FirstName = "Albert", LastName = "Einstein", Gender = "Male", FavoriteColor = "Violet", DateOfBirth = DateTime.Parse("03/14/1879")
            });
            testdata.Add(new Person()
            {
                FirstName = "Ada", LastName = "Lovelace", Gender = "Female", FavoriteColor = "Pink", DateOfBirth = DateTime.Parse("12/10/1815")
            });

            _repoMock = new Mock <IRecordsRepository>();
            _repoMock.Setup(x => x.AddRecord(It.IsAny <Person>())).Verifiable();
            _repoMock.Setup(x => x.GetAll()).Returns(testdata);
            _service = new RecordsService(_repoMock.Object);
        }
コード例 #12
0
 public FightersController(
     IFightersService fightersService,
     ICategoriesService categoriesService,
     IBiographiesService biographiesService,
     ISkillsService skillsService,
     IOrganizationsService organizationsService,
     IUsersService usersService,
     IRecordsService recordsService,
     UserManager <ApplicationUser> userManager)
 {
     this.fightersService      = fightersService;
     this.categoriesService    = categoriesService;
     this.biographiesService   = biographiesService;
     this.skillsService        = skillsService;
     this.organizationsService = organizationsService;
     this.usersService         = usersService;
     this.recordsService       = recordsService;
     this.userManager          = userManager;
 }
コード例 #13
0
        public EntitiesController(
            IIlaroAdmin admin,
            Notificator notificator,
            IRecordsService recordsService,
            IConfiguration configuration)
        {
            if (admin == null)
                throw new ArgumentNullException(nameof(admin));
            if (notificator == null)
                throw new ArgumentNullException(nameof(notificator));
            if (recordsService == null)
                throw new ArgumentException(nameof(recordsService));
            if (configuration == null)
                throw new ArgumentException(nameof(configuration));

            _admin = admin;
            _notificator = notificator;
            _recordsService = recordsService;
            _configuration = configuration;
        }
コード例 #14
0
        public RecordsServiceShould()
        {
            var goodMockSettings = new Mock <IOptions <ExternalApisSettings> >();

            goodMockSettings.SetupGet(g => g.Value).Returns(new ExternalApisSettings
            {
                TranslateApiKey        = "QQdBqnzEGB_yWgh_xx9lTNYDptLBwiPpSudeSrEbn_rH",
                TranslateApiUri        = "https://gateway-lon.watsonplatform.net/language-translator/api/v3/translate?version=2018-05-01",
                KeywordsApiKey         = "ORjN9p5UXZf8RlHBc7pSmkWM5xra3XWZha82GQrgs84",
                KeywordsApiUri         = "https://apis.paralleldots.com/v4/keywords",
                UseAlgorithmiaKeywords = false
            });

            badTranslateService = new Mock <ITranslateService>();
            badTranslateService.Setup(s => s.Translate(It.IsAny <string>())).ReturnsAsync(string.Empty);
            badKeywordsService = new Mock <IKeywordsService>();
            badKeywordsService.Setup(s => s.CollectKeywords(It.IsAny <string>())).ReturnsAsync(new List <Keyword>());

            recordsService = new RecordsService(null, new TranslateService(goodMockSettings.Object), new KeywordsService(goodMockSettings.Object));
        }
コード例 #15
0
        public InputContext(IRecordsService service)
        {
            _recordsService = service;

            IInputHandler inputHandler = new ImportFile(_recordsService);

            _inputHandlers.Add(inputHandler.TriggerKey, inputHandler);

            inputHandler = new OutputRecordsSortByGender(_recordsService);
            _inputHandlers.Add(inputHandler.TriggerKey, inputHandler);

            inputHandler = new OutputRecordsSortByDOB(_recordsService);
            _inputHandlers.Add(inputHandler.TriggerKey, inputHandler);

            inputHandler = new OutputRecordsSortByLastName(_recordsService);
            _inputHandlers.Add(inputHandler.TriggerKey, inputHandler);

            inputHandler = new Exit();
            _inputHandlers.Add(inputHandler.TriggerKey, inputHandler);
        }
コード例 #16
0
        public GroupController(
            IIlaroAdmin admin,
            Notificator notificator,
            IRecordsService recordsService)
        {
            if (admin == null)
            {
                throw new ArgumentNullException(nameof(admin));
            }
            if (notificator == null)
            {
                throw new ArgumentNullException(nameof(notificator));
            }
            if (recordsService == null)
            {
                throw new ArgumentNullException(nameof(recordsService));
            }

            _admin          = admin;
            _notificator    = notificator;
            _recordsService = recordsService;
        }
コード例 #17
0
 public RecordsServiceController(IRecordsService recordsService)
 {
     _recordsService = recordsService;
 }
コード例 #18
0
 public OutputRecordsSortByDOB(IRecordsService service)
 {
     _recordsService = service;
 }
コード例 #19
0
 public IndexModel(IRecordsService recordsService, IAppSettingsService settingsSvc)
 {
     _recordsService = recordsService;
     _settingsSvc    = settingsSvc;
 }
コード例 #20
0
 public OutputRecordsSortByLastName(IRecordsService service)
 {
     _recordsService = service;
 }
コード例 #21
0
 public RecordsController(IRecordsService service)
 {
     _service = service ?? throw new ArgumentNullException(nameof(service));
 }
コード例 #22
0
 public RecordCreatedIntegrationEventHandler(IRecordsService recordsService, IRecordEventsService recordEventsService)
 {
     _recordsService      = recordsService;
     _recordEventsService = recordEventsService;
 }
コード例 #23
0
 public UserRecordsController(IRecordsService recordsService, LinkGenerator link, IMapper mapper)
 {
     this.recordsService = recordsService;
     this.link           = link;
     this.mapper         = mapper;
 }
コード例 #24
0
 public RecordsController(IRecordsService service)
 {
     _recordsService = service;
 }
コード例 #25
0
 public RecordsController(IRecordsService recordService, IAppSettingsService appSettingsService, IRecordsThemesService recordsThemesService)
 {
     _recordService        = recordService;
     _appSettingsService   = appSettingsService;
     _recordsThemesService = recordsThemesService;
 }
コード例 #26
0
ファイル: Create.cshtml.cs プロジェクト: Aleksey-M/RiseDiary
 public CreateModel(IRecordsService recordsService)
 {
     _recordsService = recordsService;
 }
コード例 #27
0
 public OutputRecordsSortByGender(IRecordsService service)
 {
     _recordsService = service;
 }
コード例 #28
0
 public CategoriesService(ApplicationDbContext dbContext, IRecordsService recordsService)
 {
     this.dbContext      = dbContext;
     this.recordsService = recordsService;
 }
コード例 #29
0
 public RecordsController(IRecordsService recordsService, IMapper mapper)
 {
     this.recordsService = recordsService;
     this.mapper         = mapper;
 }
コード例 #30
0
 public RecordsController(IRecordsService service, UserManager <ApplicationUser> userManager)
 {
     _service     = service;
     _userManager = userManager;
 }
コード例 #31
0
 public ImportFile(IRecordsService service)
 {
     _recordsService = service;
 }