Ejemplo n.º 1
0
        public void TestValidateAndGetImageFailedParsing()
        {
            string image             = "$failToParse:543/dummy/test";
            Type   expectedException = typeof(ArgumentException);

            Assert.Throws(expectedException, () => DockerConfig.ValidateAndGetImage(image, new MockNestedEdgeParentUriParser()));
        }
Ejemplo n.º 2
0
 public void TestValidateAndGetImage(string image, string result, Type expectedException)
 {
     if (expectedException != null)
     {
         Assert.Throws(expectedException, () => DockerConfig.ValidateAndGetImage(image));
     }
     else
     {
         string updatedImage = DockerConfig.ValidateAndGetImage(image);
         Assert.Equal(result, updatedImage);
     }
 }
Ejemplo n.º 3
0
        public void TestValidateAndGetImageWithEnvVariableInHostAddress(string image, string result, Type expectedException, string variableName, string value)
        {
            MockEnvironment mock_env = new MockEnvironment();

            mock_env.SetVariable(variableName, value);

            if (expectedException != null)
            {
                Assert.Throws(expectedException, () => DockerConfig.ValidateAndGetImage(image, mock_env));
            }
            else
            {
                string updatedImage = DockerConfig.ValidateAndGetImage(image, mock_env);
                Assert.Equal(result, updatedImage);
            }
        }