Beispiel #1
0
        public static void Main(string[] args)
        {
            var triangleClassifier  = new TriangleClassifier();
            var triangleSideLengths = triangleClassifier.ParseAndValidateCommandLineArguments(args);

            if (triangleSideLengths != null)
            {
                triangleClassifier.Classify(triangleSideLengths);
            }
        }
Beispiel #2
0
        public void ParseAndValidateCommandLineArguments_NoArguments_ExpectUsageShown()
        {
            // Arrange
            var args = new string[0];

            // Act
            var triangleSideLengths = _triangleClassifier.ParseAndValidateCommandLineArguments(args);

            // Assert
            Assert.IsNull(triangleSideLengths, "No TriangleSideLengths object should have been returned");
            Assert.IsTrue(_testOutputter.WriteLineWasCalled, "Outputter.WriteLine should have been called.");
            Assert.IsTrue(_testOutputter.WriteLineTestValue.IndexOf("Usage", StringComparison.OrdinalIgnoreCase) >= 0, "Outputter.WriteLine should have been called with the usage text.");
        }