Exemple #1
0
        public void IsItalianTestNegative()
        {
            // Arrange
            Car myCar = new Car("Ford", "Focus", "blue");

            // Act
            bool isItalian = myCar.IsItalian();

            // Assert
            Assert.IsFalse(isItalian);
        }
Exemple #2
0
        public void IsItalianTestPositive()
        {
            // Arrange - create a new instance of the Car object
            //           with specific property values
            Car myCar = new Car("Maserati", "Ghibli", "black");

            // Act - invoke the method to be tested
            bool isItalian = myCar.IsItalian();

            // Assert - check that the result of the method invocation
            //          matches the expected outcome
            Assert.IsTrue(isItalian);
        }
        public void ConstraintTrueAssertion()
        {
            Car myCar = new Car("Ferrari", "F40", "red");

            Assert.That(myCar.IsItalian(), Is.True);
        }
        public void ClassicTrueAssertion()
        {
            Car myCar = new Car("Lancia", "Delta", "black");

            Assert.IsTrue(myCar.IsItalian());
        }