master
cpp 51 lines 1.1 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 WSLCE2EContainerTests.cpp
8
9 Abstract:
10
11 This file contains end-to-end tests for WSLC.
12 --*/
13
14 #include "precomp.h"
15 #include "windows/Common.h"
16 #include "WSLCCLITestHelpers.h"
17 #include "WSLCExecutor.h"
18 #include "Argument.h"
19
20 namespace WSLCE2ETests {
21 using namespace wsl::shared;
22
23 class WSLCE2EContainerTests
24 {
25 WSLC_TEST_CLASS(WSLCE2EContainerTests)
26
27 TEST_CLASS_SETUP(TestClassSetup)
28 {
29 return true;
30 }
31
32 TEST_CLASS_CLEANUP(TestClassCleanup)
33 {
34 return true;
35 }
36
37 WSLC_TEST_METHOD(WSLCE2E_Container_HelpCommand)
38 {
39 auto result = RunWslc(L"container --help");
40 result.Verify({.Stderr = L"", .ExitCode = 0});
41 VERIFY_IS_FALSE(result.Stdout.value().empty());
42 }
43
44 WSLC_TEST_METHOD(WSLCE2E_Container_InvalidCommand_DisplaysErrorMessage)
45 {
46 auto result = RunWslc(L"container INVALID_CMD");
47 result.Verify({.Stdout = L"", .ExitCode = 1});
48 VERIFY_IS_TRUE(result.StderrContainsSubstring(L"Unrecognized command: 'INVALID_CMD'"));
49 }
50 };
51 } // namespace WSLCE2ETests