public void SetUp()
        {
            wrapper = ServerWrapper.Create <Startup>(
                TestContext.CurrentContext.TestDirectory,
                services =>
            {
                services.AddSingleton(ApplicationLogging.LoggerFactory);
                services.AddLogging(item => item.AddNLog());
            },
                (context, config) =>
            {
                var env = context.HostingEnvironment;

                config.SetBasePath(env.ContentRootPath);
                config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
                config.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
                config.AddEnvironmentVariables();
                //config.AddInMemoryCollection(arrayDict);
            });
            var services = new ServiceCollection();

            services.RegisterModule(new SentimentApiModule(new Uri("http://localhost"))
            {
                Client = wrapper.Client
            });

            services.AddLogging(item => item.AddNLog());
            client = ConstructClient(services);
            services.AddSingleton(client);
            var provider = services.BuildServiceProvider();

            analysis       = provider.GetRequiredService <ISentimentAnalysis>();
            basicSentiment = provider.GetRequiredService <IBasicSentimentAnalysis>();
        }
 public void SetUp()
 {
     wrapper = ServerWrapper.Create <Startup>(TestContext.CurrentContext.TestDirectory, services => { });
 }
Exemple #3
0
 public void SetUp()
 {
     wrapper  = ServerWrapper.Create <Startup>(TestContext.CurrentContext.TestDirectory, services => { });
     analysis = new SentimentTracking(new ApiClientFactory(wrapper.Client, wrapper.Client.BaseAddress));
 }
Exemple #4
0
 public void SetUp()
 {
     System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
     wrapper = ServerWrapper.Create <Startup>(TestContext.CurrentContext.TestDirectory, services => { });
 }