예제 #1
0
        public void a_triangle_has_3_sides()
        {
            // Act
            var t = new Triangle(1, 1, 1);

            // Assert
            t.SidesCount.Should().Equal(3);
        }
예제 #2
0
        public void valid_triangle_has_no_side_equal_to_0()
        {
            // Arrange
            var t = new Triangle(0, 2, 3);

            // Act
            var isValid = t.IsValid;

            // Assert
            isValid.Should().Equal(false);
        }
예제 #3
0
        public void valid_triangle_has_2_side_sum_equal_to_third_site()
        {
            // Arrange
            var t = new Triangle(1, 2, 3);

            // Act
            var isValid = t.IsValid;

            // Assert
            isValid.Should().Equal(true);
        }
예제 #4
0
        public void Circumference_is_equal_to_the_sum_of_the_sides()
        {
            // Arrange
            var t = new Triangle(2, 3, 4);

            // Act
            var omkrets = t.Circumference;

            // Assert
            omkrets.Should().Equal(2 + 3 + 4);
        }
예제 #5
0
        public void a_triangle_with_sides_2_6_9_is_not_a_valid_triangle()
        {
            // Arrange
            var t = new Triangle(2, 6, 9);

            // Act
            var isValid = t.IsValid;

            // Assert
            isValid.Should().Equal(false);
        }