本文整理汇总了C#中Calculator.Press1方法的典型用法代码示例。如果您正苦于以下问题:C# Calculator.Press1方法的具体用法?C# Calculator.Press1怎么用?C# Calculator.Press1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calculator
的用法示例。
在下文中一共展示了Calculator.Press1方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Press1_Then_PressPlus_Should_Set_PreviousValue_To_1
public void Press1_Then_PressPlus_Should_Set_PreviousValue_To_1()
{
var calc = new Calculator();
calc.Press1();
calc.PressPlus();
Assert.AreEqual(1, calc.PreviousValue);
}
示例2: PressBackspace_Should_Set_DisplayValue_To_0_If_DisplayValue_Less_Then_10
public void PressBackspace_Should_Set_DisplayValue_To_0_If_DisplayValue_Less_Then_10()
{
var calc = new Calculator();
calc.Press1();
calc.PressBackspace();
Assert.AreEqual(0, calc.DisplayValue);
}
示例3: Press1_Should_Set_Display_Value_To_DisplayValue_Multiply_10_Plus_1
public void Press1_Should_Set_Display_Value_To_DisplayValue_Multiply_10_Plus_1()
{
var calc = new Calculator();
calc.Press9();
calc.Press1();
Assert.AreEqual(91, calc.DisplayValue);
}
示例4: PressBackspace_Should_Remove_Last_Number
public void PressBackspace_Should_Remove_Last_Number()
{
var calc = new Calculator();
calc.Press1();
calc.Press9();
calc.PressBackspace();
Assert.AreEqual(1, calc.DisplayValue);
}
示例5: Press1_Should_Reset_Display_Value_To_1_If_It_Is_Result_Of_Previous_Operations
public void Press1_Should_Reset_Display_Value_To_1_If_It_Is_Result_Of_Previous_Operations()
{
var calc = new Calculator();
calc.Press9();
calc.PressPlus();
calc.Press2();
calc.PressEqual();
calc.Press1();
Assert.AreEqual(1, calc.DisplayValue);
}
示例6: Press1_Should_Set_DisplayValue_To_1
public void Press1_Should_Set_DisplayValue_To_1()
{
var calc = new Calculator();
calc.Press1();
Assert.AreEqual(1, calc.DisplayValue);
}
示例7: _1_Plus_2_Equals_Should_Set_DisplayValue_To_3
public void _1_Plus_2_Equals_Should_Set_DisplayValue_To_3()
{
var calc = new Calculator();
calc.Press1();
calc.PressPlus();
calc.Press2();
calc.PressEqual();
Assert.AreEqual(3, calc.DisplayValue);
}