public void GetSource_ThrowsOnNotSupportedSource() { var source = new ServiceSource { Type = (SourceType)69 }; Assert.Throws <NotSupportedException>(() => source.GetSource()); }
public void GetSource_ThrowsOnInvalidSource(SourceType?type) { var source = new ServiceSource { Type = type }; Assert.Throws <InvalidOperationException>(() => source.GetSource()); }
public void GetSource_GetsGitSource() { var source = new ServiceSource { Type = SourceType.Git, CloneUrl = "https://example.com/repo.git" }; var result = source.GetSource(); var git = Assert.IsType <GitSource>(result); Assert.Equal(source.CloneUrl, git.CloneUrl); }
public void GetSource_GetsDotnetToolSource() { var source = new ServiceSource { Type = SourceType.DotnetTool, ToolName = "tool", ExtraArgs = "args" }; var result = source.GetSource(); var(_, toolName, extraArgs) = Assert.IsType <DotnetToolSource>(result); Assert.Equal(source.ToolName, toolName); Assert.Equal(source.ExtraArgs, extraArgs); }
public void GetSource_GetsDockerImageSource() { var source = new ServiceSource { Type = SourceType.DockerImage, ImageName = "image", Tag = "tag", }; var result = source.GetSource(); var(_, imageName, tag) = Assert.IsType <DockerImageSource>(result); Assert.Equal(source.ImageName, imageName); Assert.Equal(source.Tag, tag); }
public void GetSource_GetsDockerBuildSource() { var source = new ServiceSource { Type = SourceType.DockerBuild, BuildContext = "context", Tag = "tag", }; var result = source.GetSource(); var(_, buildContext, tag) = Assert.IsType <DockerBuildSource>(result); Assert.Equal(source.BuildContext, buildContext); Assert.Equal(source.Tag, tag); }