Esempio n. 1
0
            public void StackNameShouldDeserialize(
                string stackName
                )
            {
                var source = $@"""StackName={stackName}""";
                var result = JsonSerializer.Deserialize <CloudFormationStackEvent>(source);

                result !.StackName.Should().Be(stackName);
            }
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public static void RunManualTest(StackName stackName, string runExecutable = null, string browseUrl = null)
        {
            if ( runExecutable != null )
            {
                string bootConfigFilePath;
                ConfigureStack(stackName, out bootConfigFilePath);
                Process.Start(runExecutable, bootConfigFilePath);
            }

            if ( browseUrl != null )
            {
                WaitUntilUrlIsListenedTo(browseUrl, timeout: TimeSpan.FromSeconds(30));
                Process.Start(browseUrl);
            }
        }
        public static void ConfigureStack(StackName stackName, out string bootConfigFilePath)
        {
            var binFolder = PathUtility.ModuleBinPath(typeof(StackTestUtility).Assembly);
            var stackFolder = PathUtility.ModuleBinPath(typeof(StackTestUtility).Assembly, "Stacks\\" + stackName);

            bootConfigFilePath = Path.Combine(binFolder, "boot.config");

            File.Copy(
                sourceFileName: Path.Combine(stackFolder, "boot.config"),
                destFileName: bootConfigFilePath,
                overwrite: true);

            File.Copy(
                sourceFileName: Path.Combine(stackFolder, "stack.config"),
                destFileName: Path.Combine(binFolder, "stack.config"),
                overwrite: true);
        }