コード例 #1
0
ファイル: ManufactorerHP.cs プロジェクト: damy90/Telerik-all
        public override Laptop MakeLaptop()
        {
            var laptopRam = new Ram(4);
            var laptopVideoCard = new VideoCard(false);
            var motherBoear = new Motherboard(laptopRam, laptopVideoCard);
            var laptopCpu = new Cpu(new Cpu64(), 2, motherBoear);
            var laptopHDD = new HardDriver();
            var laptopHardDrives = new List<HardDriver> { new HardDriver(500, false, 0) };
            var laptopBattery = new Battery();

            return new Laptop(laptopCpu, laptopRam, laptopVideoCard, laptopHDD, laptopHardDrives, laptopBattery);
        }
コード例 #2
0
 public void BatteryChargeWithNegative100Test()
 {
     var battery = new Battery();
     battery.Charge(-100);
     Assert.AreEqual(0, battery.Percentage);
 }
コード例 #3
0
 public void BatteryChargeWith50Test()
 {
     var battery = new Battery();
     battery.Charge(50);
     Assert.AreEqual(100, battery.Percentage);
 }
コード例 #4
0
 public void BatteryChargeWith1Test()
 {
     var battery = new Battery();
     battery.Charge(1);
     Assert.AreEqual(51, battery.Percentage);
 }
コード例 #5
0
 public void BatteryCreationWith50PercentTest()
 {
     var battery = new Battery();
     Assert.AreEqual(50, battery.Percentage);
 }