コード例 #1
0
 public void TestChargeWithPositiveOutOfLimitNumber()
 {
     var laptopBattery = new LaptopBattery();
     laptopBattery.Charge(300);
     var initalPercentage = laptopBattery.Percentage;
     Assert.AreEqual(initalPercentage, 100);
 }
コード例 #2
0
 public void TestChargeWithZero()
 {
     var laptopBattery = new LaptopBattery();
     laptopBattery.Charge(0);
     var initalPercentage = laptopBattery.Percentage;
     Assert.AreEqual(initalPercentage, 50);
 }
コード例 #3
0
 public void TestChargeWithNegativeNumber()
 {
     var laptopBattery = new LaptopBattery();
     laptopBattery.Charge(-20);
     var initalPercentage = laptopBattery.Percentage;
     Assert.AreEqual(initalPercentage, 30);
 }