示例#1
0
        public void WhenOnlyPathIsSet_CommandLineIsCorrect()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build path"));
        }
        public void WhenPathIsQuoted_ArgumentIsNotDoubleQuoted(string path)
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = path
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo($"build {path}"));
        }
        public void WhenPathHasSingleQuote_ArgumentIsQuoted()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = "\""
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo(@"build """""""));
        }
示例#4
0
        public void WhenPullFlagIsSetToTrue_CommandLineDoesHavePull()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    Pull = true
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build --pull path"));
        }
示例#5
0
        public void WhenForceRmFlagIsSetToFalse_CommandLineDoesNotHaveForceRm()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    ForceRm = false
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build path"));
        }
示例#6
0
        public void WhenRmFlagIsSet_CommandLineIsCorrect()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    Rm = true
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build --rm path"));
        }