Exemplo n.º 1
0
        public void InferSourceType_InfersGit()
        {
            const SourceType expected = SourceType.Git;
            var source = new ServiceSource {
                CloneUrl = "url"
            };

            var inferred = source.InferSourceType();

            Assert.Equal(expected, inferred);
        }
Exemplo n.º 2
0
        public void InferSourceType_InfersDockerImage()
        {
            const SourceType expected = SourceType.DockerImage;
            var source = new ServiceSource {
                ImageName = "image"
            };

            var inferred = source.InferSourceType();

            Assert.Equal(expected, inferred);
        }
Exemplo n.º 3
0
        public void InferSourceType_InfersDockerBuild()
        {
            const SourceType expected = SourceType.DockerBuild;
            var source = new ServiceSource {
                BuildContext = "context"
            };

            var inferred = source.InferSourceType();

            Assert.Equal(expected, inferred);
        }
Exemplo n.º 4
0
        public void InferSourceType_ReturnsTypeWhenSet()
        {
            const SourceType expected = (SourceType)69;
            var source = new ServiceSource {
                Type = expected
            };

            var inferred = source.InferSourceType();

            Assert.Equal(expected, inferred);
        }
Exemplo n.º 5
0
 public static IServiceInstaller GetInstaller(this IServiceInstallerFactory factory, ServiceSource source)
 => source.InferSourceType() switch
 {
Exemplo n.º 6
0
 public static IServiceSource GetSource(this ServiceSource source)
 => source.InferSourceType() switch
 {