public WebAppWithDockerFileTests()
        {
            _httpHelper = new HttpHelper();

            var cloudFormationClient = new AmazonCloudFormationClient();

            _cloudFormationHelper = new CloudFormationHelper(cloudFormationClient);

            var ecsClient = new AmazonECSClient();

            _ecsHelper = new ECSHelper(ecsClient);

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddCustomServices();
            serviceCollection.AddTestServices();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _app = serviceProvider.GetService <App>();
            Assert.NotNull(_app);

            _interactiveService = serviceProvider.GetService <InMemoryInteractiveService>();
            Assert.NotNull(_interactiveService);

            _testAppManager = new TestAppManager();
        }
Exemple #2
0
        public async Task BuildCodePipelinelevel_1And2(int level, string oAuthToken)
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            var sa_parameters = new List <KeyValuePair <string, string> >();

            sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
            sa_parameters.Add(new KeyValuePair <string, string>("OAuthToken", oAuthToken));

            string stackName = $"{GlobalVariables.Enviroment}-level-{level}";

            if (level == 2)
            {
                sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
                stackName += $"-{GlobalVariables.Color}";
            }

            await helper.CreateStack
            (
                ConfigurationManager.AppSettings["InfraFileFolder"],
                stackName,
                ReadCodePipelineConfigs(level),
                sa_parameters
            );

            LogServices.WriteLog($"{GlobalVariables.Enviroment}-level-{level}-{GlobalVariables.Color} is created.",
                                 LogType.Information, GlobalVariables.Enviroment.ToString());
        }
Exemple #3
0
        public async Task <List <SA_Stack> > GetStackList()
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            return(await helper.GetStackList());
        }
Exemple #4
0
        public async Task <string> DeleteStack(string stackName, AsyncCallback callBack)
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            return(await helper.DeleteStack(stackName, callBack));
        }
 public IntegrationTestContextFixture()
 {
     _cloudFormationHelper = new CloudFormationHelper(new AmazonCloudFormationClient(Amazon.RegionEndpoint.USWest2));
     _s3Helper             = new S3Helper(new AmazonS3Client(Amazon.RegionEndpoint.USWest2));
     LambdaHelper          = new LambdaHelper(new AmazonLambdaClient(Amazon.RegionEndpoint.USWest2));
     CloudWatchHelper      = new CloudWatchHelper(new AmazonCloudWatchLogsClient(Amazon.RegionEndpoint.USWest2));
     HttpClient            = new HttpClient();
 }
Exemple #6
0
        public ServerModeTests()
        {
            var cloudFormationClient = new AmazonCloudFormationClient(Amazon.RegionEndpoint.USWest2);

            _cloudFormationHelper = new CloudFormationHelper(cloudFormationClient);

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddCustomServices();
            serviceCollection.AddTestServices();

            _serviceProvider = serviceCollection.BuildServiceProvider();

            _awsRegion = "us-west-2";

            _testAppManager = new TestAppManager();
        }
Exemple #7
0
        //No color for now.
        public async Task SetDNS()
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            var sa_parameters = new List <KeyValuePair <string, string> >();

            sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
            sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
            string stackName = $"{GlobalVariables.Enviroment}-DNS";

            await helper.CreateStack
            (
                ConfigurationManager.AppSettings["InfraFileFolder"],
                stackName,
                ReadCodePipelineConfigs(4),
                sa_parameters
            );
        }
        public BlazorWasmTests()
        {
            _httpHelper = new HttpHelper();

            _cloudFormationHelper = new CloudFormationHelper(new AmazonCloudFormationClient());
            _cloudFrontHelper     = new CloudFrontHelper(new Amazon.CloudFront.AmazonCloudFrontClient());

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddCustomServices();
            serviceCollection.AddTestServices();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _app = serviceProvider.GetService <App>();
            Assert.NotNull(_app);

            _interactiveService = serviceProvider.GetService <InMemoryInteractiveService>();
            Assert.NotNull(_interactiveService);

            _testAppManager = new TestAppManager();
        }
Exemple #9
0
        public ElasticBeanStalkDeploymentTest()
        {
            _httpHelper = new HttpHelper();

            var cloudFormationClient = new AmazonCloudFormationClient();

            _cloudFormationHelper = new CloudFormationHelper(cloudFormationClient);

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddCustomServices();
            serviceCollection.AddTestServices();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            _app = serviceProvider.GetService <App>();
            Assert.NotNull(_app);

            _interactiveService = serviceProvider.GetService <InMemoryInteractiveService>();
            Assert.NotNull(_interactiveService);

            _testAppManager = new TestAppManager();
        }
Exemple #10
0
        public async Task BuildCodePipelinelevel_3(List <string> apps)
        {
            var helper = new CloudFormationHelper(
                GlobalVariables.Enviroment, GlobalVariables.Region, GlobalVariables.Color);

            foreach (string app in apps)
            {
                var sa_parameters = new List <KeyValuePair <string, string> >();
                sa_parameters.Add(new KeyValuePair <string, string>("Environment", GlobalVariables.Enviroment.ToString()));
                sa_parameters.Add(new KeyValuePair <string, string>("Color", GlobalVariables.Color));
                sa_parameters.Add(new KeyValuePair <string, string>("Application", app));

                await helper.CreateStack
                (
                    ConfigurationManager.AppSettings["InfraFileFolder"],
                    $"{GlobalVariables.Enviroment}-level-3-{app}-{GlobalVariables.Color}",
                    ReadCodePipelineConfigs(3),
                    sa_parameters
                );

                LogServices.WriteLog($"{GlobalVariables.Enviroment}-level-3-{GlobalVariables.Color}-{app} is created.",
                                     LogType.Information, GlobalVariables.Enviroment.ToString());
            }
        }