Fix UnitTests

This commit is contained in:
Eric Tian 2021-03-06 15:07:40 -08:00
commit f16cbb88b1

View file

@ -97,7 +97,7 @@ namespace CalculatorUnitTests
// Boundary testing // Boundary testing
VERIFY_ARE_EQUAL(ViewMode::None, NavCategory::Deserialize(ref new Box<int>(-1))); VERIFY_ARE_EQUAL(ViewMode::None, NavCategory::Deserialize(ref new Box<int>(-1)));
VERIFY_ARE_EQUAL(ViewMode::None, NavCategory::Deserialize(ref new Box<int>(19))); VERIFY_ARE_EQUAL(ViewMode::None, NavCategory::Deserialize(ref new Box<int>(18)));
} }
void NavCategoryUnitTests::IsValidViewMode_AllValid() void NavCategoryUnitTests::IsValidViewMode_AllValid()
@ -131,15 +131,15 @@ namespace CalculatorUnitTests
if (Windows::Foundation::Metadata::ApiInformation::IsMethodPresent("Windows.UI.Text.RichEditTextDocument", "GetMath")) if (Windows::Foundation::Metadata::ApiInformation::IsMethodPresent("Windows.UI.Text.RichEditTextDocument", "GetMath"))
{ {
// There are 19 total options so int 19 should be the first invalid // There are 18 total options so int 18 should be the first invalid
VERIFY_IS_TRUE(NavCategory::IsValidViewMode(static_cast<ViewMode>(18))); VERIFY_IS_TRUE(NavCategory::IsValidViewMode(static_cast<ViewMode>(17)));
VERIFY_IS_FALSE(NavCategory::IsValidViewMode(static_cast<ViewMode>(19))); VERIFY_IS_FALSE(NavCategory::IsValidViewMode(static_cast<ViewMode>(18)));
} }
else else
{ {
// There are 18 total options when graphing calculator is not present, so int 18 should be the first invalid // There are 18 total options when graphing calculator is not present, so int 18 should be the first invalid
VERIFY_IS_TRUE(NavCategory::IsValidViewMode(static_cast<ViewMode>(17))); VERIFY_IS_TRUE(NavCategory::IsValidViewMode(static_cast<ViewMode>(16)));
VERIFY_IS_FALSE(NavCategory::IsValidViewMode(static_cast<ViewMode>(18))); VERIFY_IS_FALSE(NavCategory::IsValidViewMode(static_cast<ViewMode>(17)));
} }
// Also verify the lower bound // Also verify the lower bound