Exemplo n.º 1
0
        public void DefaultTest()
        {
            IOryxArguments args = new LinuxConsumptionFunctionAppOryxArguments();

            Assert.False(args.RunOryxBuild);
            Assert.True(args.SkipKuduSync);
            Assert.Equal(BuildOptimizationsFlags.Off, args.Flags);

            var mockedContext = new DeploymentContext()
            {
                RepositoryPath = "RepositoryPath",
                BuildTempPath  = "BuildTempPath", // Should be ignored
                OutputPath     = "OutputPath"
            };
            string command = args.GenerateOryxBuildCommand(mockedContext);

            Assert.Equal("oryx build RepositoryPath -o OutputPath", command);
        }
Exemplo n.º 2
0
        public void CommandGenerationTest(string functions_worker_runtime, string expected_command)
        {
            var mockedEnvironment = new Dictionary <string, string>()
            {
                { "FUNCTIONS_WORKER_RUNTIME", functions_worker_runtime },
            };

            var mockedContext = new DeploymentContext()
            {
                RepositoryPath = "RepositoryPath",
                BuildTempPath  = "BuildTempPath", // Should be ignored
                OutputPath     = "OutputPath"     // Should be ignored
            };

            using (new TestScopedEnvironmentVariable(mockedEnvironment))
            {
                IOryxArguments args    = new LinuxConsumptionFunctionAppOryxArguments();
                string         command = args.GenerateOryxBuildCommand(mockedContext);
                Assert.Equal(expected_command, command);
            }
        }