calculator/internal/Calculator.UIAutomationLibrary/Components/Pages/DateCalculatorLfm.cs
Howard Wolosky c13b8a099e Hello GitHub
2019-01-28 16:24:37 -08:00

37 lines
995 B
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Calculator.UIAutomationLibrary.Components
{
public class DateCalculatorLfm
{
public DateCalculatorLfm(DateCalculatorPom dateCalculatorPom)
{
this.ObjectModel = dateCalculatorPom;
}
public DateCalculatorPom ObjectModel { get; }
public void EnsureDateDifferenceMode()
{
this.OpenModeSelector();
this.ObjectModel.ModeSelector.AllItems[0].Select();
}
public void EnsureAddSubtractMode()
{
this.OpenModeSelector();
this.ObjectModel.ModeSelector.AllItems[1].Select();
}
private void OpenModeSelector()
{
using (var waiter = this.ObjectModel.ModeSelector.GetExpandedWaiter())
{
this.ObjectModel.ModeSelector.Expand();
waiter.TryWait();
}
}
}
}