Ejemplo n.º 1
0
        public void Test_Repair()
        {
            var newPhonePart = new PhonePart("valid", 2, true);

            newPhonePart.Repair();
            Assert.AreEqual(false, newPhonePart.IsBroken);
        }
        public void PhonePartRepairShouldWorksCorrectly()
        {
            var part = new PhonePart("JustLaptopPart", 2.50M, true);

            part.Repair();

            Assert.IsFalse(part.IsBroken);
        }
Ejemplo n.º 3
0
        public void PhonePartRepairShouldTurnIsBrokenToFalse()
        {
            var phonePart = new PhonePart("ram", 100m, true);

            phonePart.Repair();

            Assert.IsFalse(phonePart.IsBroken);
        }
Ejemplo n.º 4
0
        public void TestRepairPhonePartShouldFixBrokenPart()
        {
            IPart phonePart = new PhonePart(PartName, PartCost);

            phonePart.Repair();

            Assert.IsTrue(phonePart.IsBroken == false);
        }
Ejemplo n.º 5
0
        public void RepairMethod_ShouldSet_IsBrokenProperty_ToFalse()
        {
            //Arrange
            bool      expectedCondition = false;
            PhonePart itemPart          = new PhonePart("Camera", 10m, true);

            //Act
            itemPart.Repair();

            //Assert
            Assert.That(expectedCondition, Is.EqualTo(itemPart.IsBroken));
        }
Ejemplo n.º 6
0
        public void Part_RepairMethod()
        {
            var phonePartBroken  = new PhonePart("name", 1, true);
            var pcPartBroken     = new PhonePart("name2", 1, true);
            var laptopPartBroken = new PhonePart("name3", 1, true);
            var laptopPart       = new PhonePart("name3", 1, false);

            Assert.That(laptopPart.IsBroken == false);
            Assert.That(laptopPartBroken.IsBroken == true);
            Assert.That(phonePartBroken.IsBroken == true);
            Assert.That(pcPartBroken.IsBroken == true);

            laptopPart.Repair();
            laptopPartBroken.Repair();
            phonePartBroken.Repair();
            pcPartBroken.Repair();

            Assert.That(laptopPart.IsBroken == false);
            Assert.That(laptopPartBroken.IsBroken == false);
            Assert.That(phonePartBroken.IsBroken == false);
            Assert.That(pcPartBroken.IsBroken == false);
        }