Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring PushNotification unit tests #2389

Merged
merged 16 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/PowerNotifications/APITests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

#include "pch.h"
#include "winrt/Microsoft.Windows.System.Power.h"
#include "winrt/Microsoft.Windows.PushNotifications.h"

using namespace std::chrono_literals;
using namespace winrt::Microsoft::Windows::System::Power;
using namespace winrt::Microsoft::Windows::PushNotifications;

namespace Test::PowerNotifications
{
Expand Down Expand Up @@ -51,8 +53,10 @@ namespace Test::PowerNotifications

TEST_METHOD(GetBatteryStatus)
{
auto value = PowerManager::BatteryStatus();
VERIFY_ARE_EQUAL(value, BatteryStatus::NotPresent);
/*auto value = PowerManager::BatteryStatus();
VERIFY_ARE_EQUAL(value, BatteryStatus::NotPresent);*/

PushNotificationManager::Default().Register();
}

TEST_METHOD(GetPowerSupplyStatus)
Expand Down
6 changes: 5 additions & 1 deletion test/PowerNotifications/PowerNotifications.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Windows.PushNotifications">
<HintPath>..\..\BuildOutput\Debug\x64\WindowsAppRuntime_DLL\Microsoft.Windows.PushNotifications.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="Microsoft.Windows.System.Power">
<HintPath>$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.System.Power.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
Expand Down Expand Up @@ -210,4 +214,4 @@
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
</Project>
328 changes: 0 additions & 328 deletions test/PushNotificationTests/APITests.cpp

This file was deleted.

5 changes: 5 additions & 0 deletions test/PushNotificationTests/LRPTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ namespace Test::PushNotifications
try
{
VERIFY_SUCCEEDED(::CoInitializeEx(nullptr, COINITBASE_MULTITHREADED));
TP::RemovePackage_PushNotificationsLongRunningTask();
TP::RemovePackage_DynamicDependencyLifetimeManager();
TP::RemovePackage_DynamicDependencyDataStore();
TP::RemovePackage_WindowsAppRuntimeFramework();

TP::AddPackage_WindowsAppRuntimeFramework(); // Installs WASfwk
TP::AddPackage_DynamicDependencyDataStore(); // Installs WASmain
TP::AddPackage_DynamicDependencyLifetimeManager(); // Installs WASddlm
Expand Down
Loading