コード例 #1
0
        public void ChargeShouldNotGoAbove100()
        {
            var battery = new LaptopBattery();
            battery.Charge(51);

            Assert.AreEqual(100, battery.Percentage);
        }
コード例 #2
0
        public void ChargeShouldNotGoBelowZero()
        {
            var battery = new LaptopBattery();
            battery.Charge(-51);

            Assert.AreEqual(0, battery.Percentage);
        }
コード例 #3
0
        public void ChargeWorksCorrectWithNegativeValues()
        {
            var battery = new LaptopBattery();
            battery.Charge(-1);

            Assert.AreEqual(49, battery.Percentage);
        }
コード例 #4
0
 public ComputerServer(
     Cpu cpu,
     Ram ram,
     IEnumerable<HardDrive> hardDrives,
     HardDrive hardDrive,
     LaptopBattery battery,
     Videocard videocard)
     : base(cpu, ram, hardDrives, hardDrive, battery, videocard)
 {
 }
コード例 #5
0
ファイル: Computer.cs プロジェクト: MarKamenov/TelerikAcademy
 internal Computer(
     Cpu cpu,
     IRam ram,
     IEnumerable<HardDrive> hardDrives,
     IHardDrive hardDrive,
     LaptopBattery battery,
     IVideocard videocard)
 {
     this.cpu = cpu;
     this.ram = ram;
     this.hardDrives = hardDrives;
     this.hardDrive = hardDrive;
     this.videocard = videocard;
     this.battery = battery;
 }
コード例 #6
0
        public void InitialChargeMustBe50()
        {
            var battery = new LaptopBattery();

            Assert.AreEqual(50, battery.Percentage);
        }