Added Azure Blob Container support.

This commit is contained in:
Bruce Horn
2024-03-17 12:56:37 +00:00
committed by Caelan Sayler
parent d03caa0cc2
commit bfb834b5da
7 changed files with 363 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System.CommandLine;
using Velopack.Vpk.Commands;
namespace Velopack.CommandLine.Tests.Commands;
public abstract class AzureCommandTests<T> : BaseCommandTests<T>
where T : AzureBaseCommand, new()
{
[Fact]
public void Command_WithRequiredEndpointOptions_ParsesValue()
{
AzureBaseCommand command = new T();
string cli = $"--account \"account-name\" --key \"shhhh\" --endpoint \"https://endpoint\" --container \"mycontainer\"";
ParseResult parseResult = command.ParseAndApply(cli);
Assert.Empty(parseResult.Errors);
Assert.Equal("account-name", command.Account);
Assert.Equal("shhhh", command.Key);
Assert.Equal("https://endpoint/", command.Endpoint);
Assert.Equal("mycontainer", command.Container);
}
}
public class AzureDownloadCommandTests : AzureCommandTests<AzureDownloadCommand>
{ }
public class AzureUploadCommandTests : AzureCommandTests<AzureUploadCommand>
{
public override bool ShouldBeNonEmptyReleaseDir => true;
//[Fact]
//public void KeepMaxReleases_WithNumber_ParsesValue()
//{
// var command = new S3UploadCommand();
// string cli = GetRequiredDefaultOptions() + "--keepMaxReleases 42";
// ParseResult parseResult = command.ParseAndApply(cli);
// Assert.Equal(42, command.KeepMaxReleases);
//}
}