コード例 #1
0
        public TranslationControllerTests()
        {
            var translationHelper = new Mock <ITranslationHelper>();

            translationHelper.Setup(x => x.GetTranslation(It.IsAny <LanguageCode>(), It.IsAny <string>())).Returns("NOTFOUND");
            translationHelper.Setup(x => x.GetTranslation(LanguageCode.ENG, "ENGtest")).Returns("English testing");
            translationHelper.Setup(x => x.GetTranslation(LanguageCode.PL, "PLtest")).Returns("Polskie testowanie");
            _translationHelper = translationHelper.Object;
            _dbContext         = new Mock <WebNeuralNetDbContext>().Object;
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, WebNeuralNetDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
            });

            app.UseHttpsRedirection();
            app.UseAuthentication();
            app.UseCors();
            app.UseMvc();
        }
コード例 #3
0
 public TranslationController(ITranslationHelper translationHelper, WebNeuralNetDbContext dbContext)
 {
     _translationHelper = translationHelper;
     _dbContext         = dbContext;
 }
コード例 #4
0
 public NeuralNetController(WebNeuralNetDbContext dbContext, INeuralNetCreator neuralNetCreator, INeuralNetTrainer neuralNetTrainer)
 {
     _dbcontext        = dbContext;
     _neuralNetCreator = neuralNetCreator;
     _neuralNetTrainer = neuralNetTrainer;
 }
コード例 #5
0
 public ExportController(WebNeuralNetDbContext dbContext)
 {
     _dbcontext = dbContext;
 }
コード例 #6
0
 public LayerController(WebNeuralNetDbContext dbContext, INeuralNetCreator neuralNetCreator)
 {
     _dbContext        = dbContext;
     _neuralNetCreator = neuralNetCreator;
 }