public void InferSourceType_InfersGit() { const SourceType expected = SourceType.Git; var source = new ServiceSource { CloneUrl = "url" }; var inferred = source.InferSourceType(); Assert.Equal(expected, inferred); }
public void InferSourceType_InfersDockerImage() { const SourceType expected = SourceType.DockerImage; var source = new ServiceSource { ImageName = "image" }; var inferred = source.InferSourceType(); Assert.Equal(expected, inferred); }
public void InferSourceType_InfersDockerBuild() { const SourceType expected = SourceType.DockerBuild; var source = new ServiceSource { BuildContext = "context" }; var inferred = source.InferSourceType(); Assert.Equal(expected, inferred); }
public void InferSourceType_ReturnsTypeWhenSet() { const SourceType expected = (SourceType)69; var source = new ServiceSource { Type = expected }; var inferred = source.InferSourceType(); Assert.Equal(expected, inferred); }
public static IServiceInstaller GetInstaller(this IServiceInstallerFactory factory, ServiceSource source) => source.InferSourceType() switch {
public static IServiceSource GetSource(this ServiceSource source) => source.InferSourceType() switch {