public MainWindow()
 {
     InitializeComponent();
     expression      = new StringBuilder(500);
     calculator      = new Calculator(new Validator(), new ExpressionNormalizer());
     bunchCalculator = new BunchCalculator(calculator);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            var(error, inputFile, outputFile) = ParseCommandLineArguments(args);

            if (error != null)
            {
                Console.WriteLine(error);
                return;
            }

            var directory = Path.GetDirectoryName(outputFile);

            if (!string.IsNullOrEmpty(directory))
            {
                Directory.CreateDirectory(directory);
            }

            var bunchCalculator = new BunchCalculator(new Calculator(new Validator(), new ExpressionNormalizer()));
            var expressions     = File.ReadLines(inputFile);
            var results         = bunchCalculator.Calculate(expressions);

            FileExtensions.WriteAllLines(outputFile, results);
        }
 public void Setup()
 {
     bunchCalculator = new BunchCalculator(new Calculator(new Validator(), new ExpressionNormalizer()));
 }