mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[FancyZones] Refactor Zone class (#7022)
* Pass zoneId on zone creaton and make it const Refactor IZone and Zone - make methods const and remove SetId * Update tests * Fix Grid layout zone order
This commit is contained in:
@@ -22,7 +22,7 @@ namespace FancyZonesUnitTests
|
||||
public:
|
||||
TEST_METHOD(TestCreateZone)
|
||||
{
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect);
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect, 1);
|
||||
Assert::IsNotNull(&zone);
|
||||
CustomAssert::AreEqual(m_zoneRect, zone->GetZoneRect());
|
||||
}
|
||||
@@ -30,18 +30,17 @@ namespace FancyZonesUnitTests
|
||||
TEST_METHOD(TestCreateZoneZeroRect)
|
||||
{
|
||||
RECT zoneRect{ 0, 0, 0, 0 };
|
||||
winrt::com_ptr<IZone> zone = MakeZone(zoneRect);
|
||||
winrt::com_ptr<IZone> zone = MakeZone(zoneRect, 1);
|
||||
Assert::IsNotNull(&zone);
|
||||
CustomAssert::AreEqual(zoneRect, zone->GetZoneRect());
|
||||
}
|
||||
|
||||
TEST_METHOD(GetSetId)
|
||||
{
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect);
|
||||
constexpr size_t zoneId = 123;
|
||||
winrt::com_ptr<IZone> zone = MakeZone(m_zoneRect, zoneId);
|
||||
|
||||
constexpr size_t id = 10;
|
||||
zone->SetId(id);
|
||||
Assert::AreEqual(zone->Id(), id);
|
||||
Assert::AreEqual(zone->Id(), zoneId);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user