예제 #1
0
        private static void HandleOutput(CliOptions options, FibonacciResultSet resultSet)
        {
            IFibonacciOutput outputMethod;

            if (options.OutputFile == null)
            {
                outputMethod = new DirectFibonacciOutput();
            }
            else if (Path.GetExtension(options.OutputFile) == ".xml")
            {
                outputMethod = new XMLFibonacciOutput(options.OutputFile);
            }
            else
            {
                outputMethod = new PlainTextFibonacciOutput(options.OutputFile);
            }

            outputMethod.WriteResult(resultSet);
        }
 public void TestInitialize()
 {
     _fibWriter = new XMLFibonacciOutput(_testFilePath);
     _calculator = new FibonacciCalculator.Calculator();
 }