mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[FancyZones] Window switch shortcut fix (#21426)
* rename Layout -> LayoutData * simplify zone * split ZoneSet: Layout * refactoring * split ZoneSet: LayoutWindows * update trace * split ZoneSet: remove ZoneSet * fix initialization * split unit tests * remove unused * warning * nullptr check * use current rect * update work area tests * use current rect * simplify * more meaningful name * dismiss * safety checks * resolve conflicts * reassign windows after switching vd * avoid double-processing for window on switching vd * extend windows fix * check if window is on current desktop before cycling * separated extend * not reinit layout windows
This commit is contained in:
@@ -22,25 +22,38 @@ namespace FancyZonesUnitTests
|
||||
public:
|
||||
TEST_METHOD(TestCreateZone)
|
||||
{
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect, 1);
|
||||
Assert::IsNotNull(&zone);
|
||||
CustomAssert::AreEqual(m_zoneRect, zone->GetZoneRect());
|
||||
Zone zone(m_zoneRect, 1);
|
||||
Assert::IsTrue(zone.IsValid());
|
||||
CustomAssert::AreEqual(m_zoneRect, zone.GetZoneRect());
|
||||
}
|
||||
|
||||
TEST_METHOD(TestCreateZoneZeroRect)
|
||||
{
|
||||
RECT zoneRect{ 0, 0, 0, 0 };
|
||||
winrt::com_ptr<IZone> zone = MakeZone(zoneRect, 1);
|
||||
Assert::IsNotNull(&zone);
|
||||
CustomAssert::AreEqual(zoneRect, zone->GetZoneRect());
|
||||
Zone zone(zoneRect, 1);
|
||||
Assert::IsTrue(zone.IsValid());
|
||||
CustomAssert::AreEqual(zoneRect, zone.GetZoneRect());
|
||||
}
|
||||
|
||||
TEST_METHOD(GetSetId)
|
||||
{
|
||||
constexpr ZoneIndex zoneId = 123;
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect, zoneId);
|
||||
Zone zone(m_zoneRect, zoneId);
|
||||
|
||||
Assert::AreEqual(zone->Id(), zoneId);
|
||||
Assert::IsTrue(zone.IsValid());
|
||||
Assert::AreEqual(zone.Id(), zoneId);
|
||||
}
|
||||
|
||||
TEST_METHOD(InvalidId)
|
||||
{
|
||||
Zone zone(m_zoneRect, -1);
|
||||
Assert::IsFalse(zone.IsValid());
|
||||
}
|
||||
|
||||
TEST_METHOD (InvalidRect)
|
||||
{
|
||||
Zone zone({ 100, 100, 99, 101 }, 1);
|
||||
Assert::IsFalse(zone.IsValid());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user