-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tests.cpp
50 lines (41 loc) · 1.18 KB
/
Tests.cpp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "pch.h"
#include <winrt/Example.h>
#include <wil/filesystem.h>
namespace cpp_unit = Microsoft::VisualStudio::CppUnitTestFramework;
winrt::Example::Class make_example();
TEST_CLASS(TestClass)
{
TEST_METHOD(TestMethod)
{
cpp_unit::Assert::IsTrue(true);
}
TEST_METHOD(CreateAndCallWinRtObject)
{
winrt::Example::Class testClass;
testClass.Method();
}
TEST_METHOD(Fail)
{
cpp_unit::Assert::IsTrue(false);
}
TEST_METHOD(CallMake)
{
auto e = make_example();
e.Method();
}
TEST_METHOD(UseAsyncMethodsSynchronously)
{
using namespace winrt::Windows::System;
using namespace winrt::Windows::Foundation;
auto uri = Uri(L"http://www.msn.com");
auto r = Launcher::LaunchUriAsync(uri).get();;
}
TEST_METHOD(VerifyRunSettingsFileConfiguresMta)
{
APTTYPE aptType{};
APTTYPEQUALIFIER aptTypeQualifier{};
THROW_IF_FAILED(CoGetApartmentType(&aptType, &aptTypeQualifier));
// Verify test.runsettings is working
cpp_unit::Assert::IsTrue(aptType == APTTYPE_MTA);
}
};