Exemplo n.º 1
0
        public void Classifier_Equilateral_ExpectCorrectAnswer()
        {
            // Arrange
            var triangleSideLengths = new TriangleSideLengths
            {
                LengthOfSideA = 12,
                LengthOfSideB = 12,
                LengthOfSideC = 12
            };

            // Act
            _triangleClassifier.Classify(triangleSideLengths);

            // Assert
            Assert.IsTrue(_testOutputter.WriteLineWasCalled, "Outputter.WriteLine should have been called.");
            Assert.AreEqual("All sides have the same length. That means that the triangle is equilateral.", _testOutputter.WriteLineTestValue, "Outputter.WriteLine should have been called with the correct text.");
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            var triangleClassifier  = new TriangleClassifier();
            var triangleSideLengths = triangleClassifier.ParseAndValidateCommandLineArguments(args);

            if (triangleSideLengths != null)
            {
                triangleClassifier.Classify(triangleSideLengths);
            }
        }
Exemplo n.º 3
0
 private void calculateClassification()
 {
     _type = TriangleClassifier.Classify(this);
 }