forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppShutdown.cpp
More file actions
26 lines (21 loc) · 756 Bytes
/
Copy pathAppShutdown.cpp
File metadata and controls
26 lines (21 loc) · 756 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
25
26
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include <winget/Runtime.h>
#include "Commands/TestCommand.h"
using namespace AppInstaller::CLI;
TEST_CASE("AppShutdown_WindowMessage", "[appShutdown]")
{
if (AppInstaller::Runtime::IsRunningAsAdmin() && AppInstaller::Runtime::IsRunningInPackagedContext())
{
WARN("Test can't run as admin in package context");
return;
}
std::ostringstream output;
Execution::Context context{ output, std::cin };
context.Args.AddArg(Execution::Args::Type::Force);
TestAppShutdownCommand appShutdownCmd({});
appShutdownCmd.Execute(context);
REQUIRE(context.IsTerminated());
REQUIRE(S_OK == context.GetTerminationHR());
}