public ImportIntoS3Tasks() { appHost = new BasicAppHost().Init(); var s3Client = new AmazonS3Client(AwsConfig.AwsAccessKey, AwsConfig.AwsSecretKey, RegionEndpoint.USEast1); s3 = new S3VirtualPathProvider(s3Client, AwsConfig.S3BucketName, appHost); }
public void TestFixtureSetUp() { _listeningOn = "http://localhost:1234/api/"; appHost = new TestAppHost { ConfigureContainer = container => { var dbFactory = new OrmLiteConnectionFactory( "Data Source=mydb.db;Version=3;", SqliteDialect.Provider); container.Register<IDbConnectionFactory>(dbFactory); container.RegisterAutoWiredAs <PlacesToVisitRepository, IPlacesToVisitRepository>(); container.Register(new PlacesToVisitAppSettings()); var repo = container.Resolve<IPlacesToVisitRepository>(); repo.InitializeSchema(); _seedData.CreateUsers(container); _seedData.SeedPlaces(repo); }, ConfigureAppHost = host => { host.Plugins.Add(new ValidationFeature()); host.Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { new BasicAuthProvider() })); } }.Init().Start(_listeningOn); }
public UnitTests() { appHost = new BasicAppHost(typeof(ListOfPluginsService).Assembly) { } .Init(); appHost.Container.Register<IData>(x => new Data()).ReusedWithin(ReuseScope.Container); }
public EchoTests() { _appHost = new BasicAppHost(typeof(EchoService).Assembly) { ConfigureContainer = container => { } } .Init(); }
public LimitKeyGeneratorTests() { if (ServiceStackHost.Instance == null) { appHost = new BasicAppHost { TestMode = true }.Init(); // The GetConsumerId method requires an AuthUserSession. AuthenticateService.Init(() => new AuthUserSession(), new BasicAuthProvider(appHost.AppSettings)); } }
public static void BindHost(ServiceStackHost appHost, IApplicationBuilder app) { var logFactory = app.ApplicationServices.GetService<ILoggerFactory>(); if (logFactory != null) { LogManager.LogFactory = new NetCoreLogFactory(logFactory); } appHost.Container.Adapter = new NetCoreContainerAdapter(app.ApplicationServices); }
public WorkspaceTests() { _appHost = new BasicAppHost(typeof(WorkspaceService).Assembly) { ConfigureContainer = container => { } } .Init(); }
public UnitTests() { appHost = new BasicAppHost(typeof(ServiceInterface.SimpleDb.Domain.SimpleDbDomainService).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here } } .Init(); }
public UnitTests() { appHost = new BasicAppHost(typeof(MyServices).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here } } .Init(); }
public ConcurrentRequestsTest() { var containerBuilder = new ContainerBuilder(); containerBuilder.RegisterType<ValueHolder>().AsSelf().InstancePerRequest(); var container = containerBuilder.Build(); _appHost = new AppHost() .UseAutofac(container) .Init() .Start($"http://*:{ServicePort}/"); }
public void TestFixtureSetUp() { appHost = new BasicAppHost(typeof(SkyBillService).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here container.Register<IBillBL>(c => new BillStub { }); } } .Init(); }
public UnitTests() { appHost = new BasicAppHost(typeof(ServerEventsServices).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here container.RegisterAutoWiredAs<MemoryChatHistory, IChatHistory>(); } } .Init(); }
public AdminTasks() { appHost = new BasicAppHost(typeof(MyServices).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here container.Register<IDbConnectionFactory>(new OrmLiteConnectionFactory("~/App_Data/db.sqlite".MapHostAbsolutePath(),SqliteDialect.Provider)); } } .Init(); }
public UnitTests() { appHost = new BasicAppHost(typeof(EmailServices).Assembly) { ConfigureContainer = container => { container.Register<IDbConnectionFactory>(c => new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider)); container.RegisterAs<DbEmailer, IEmailer>(); using (var db = container.TryResolve<IDbConnectionFactory>().Open()) { db.DropAndCreateTable<Contact>(); db.DropAndCreateTable<Email>(); db.Insert(new Contact { Name = "Test Contact", Email = "*****@*****.**", Age = 10 }); } } } .Init(); }
public AdminTasks() { appHost = new BasicAppHost().Init(); s3 = AwsConfig.CreateS3VirtualPathProvider(appHost, AwsConfig.S3BucketName); }
public UnitTests() { appHost = new AppHost(); appHost.Init().Start("http://*:2337/"); }
public void TestFixtureSetUp() { _appHost = new BasicAppHost { ConfigureContainer = c => { var authService = new AuthenticateService(); c.Register(authService); c.Register<IAuthSession>(AuthUserSession); AuthenticateService.Init(() => AuthUserSession, new CredentialsAuthProvider()); } }.Init(); }
protected virtual void Dispose(bool disposing) { if (disposing) { // free managed resources if (AppHost != null) { AppHost.Dispose(); AppHost = null; } } // Free native resources // <None> }
public UnitTests() { appHost = new BasicAppHost(typeof(MyServices).Assembly) { ConfigureContainer = container => { //Add your IoC dependencies here container.Register<IDbConnectionFactory>( new OrmLiteConnectionFactory( "~/../../../StackApis/App_Data/db.sqlite".MapServerPath(), SqliteDialect.Provider)); using (var db = container.Resolve<IDbConnectionFactory>().OpenDbConnection()) { db.DropAndCreateTable<Question>(); db.DropAndCreateTable<Answer>(); db.DropAndCreateTable<QuestionTag>(); } SeedStackOverflowData(container.Resolve<IDbConnectionFactory>()); } } .Init(); }
public void TestFixtureSetUp() { appHost = new AppHost() .Init() .Start("http://*:2020/"); }