forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDownloadFlow.cpp
More file actions
24 lines (20 loc) · 995 Bytes
/
Copy pathDownloadFlow.cpp
File metadata and controls
24 lines (20 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include "WorkflowCommon.h"
#include <Commands/DownloadCommand.h>
using namespace TestCommon;
using namespace AppInstaller::CLI;
TEST_CASE("DownloadFlow_DownloadCommandProhibited", "[DownloadFlow][workflow]")
{
std::ostringstream downloadOutput;
TestContext context{ downloadOutput, std::cin };
auto previousThreadGlobals = context.SetForCurrentThread();
context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("DownloadFlowTest_DownloadCommandProhibited.yaml").GetPath().u8string());
DownloadCommand download({});
download.Execute(context);
INFO(downloadOutput.str());
// Verify AppInfo is printed
REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_DOWNLOAD_COMMAND_PROHIBITED);
REQUIRE(downloadOutput.str().find(Resource::LocString(Resource::String::InstallerDownloadCommandProhibited).get()) != std::string::npos);
}