public void Add_AnyString_WritesToLog(string number, string loggedMessage)
        {
            IMyLogger logger = new FakeLogger();

            var calculator = StringCalculatorFactory(true, logger);

            calculator.Add(number);

            Assert.AreEqual(loggedMessage, logger.Message);
        }
        private static StringCalculator StringCalculatorFactory(string appSettingsKey)
        {
            var settings = new Settings();
            var appSettings = ConfigurationManager.AppSettings;
            var isEnabledFromFile = appSettings[appSettingsKey];
            settings.IsEnabled = bool.Parse(isEnabledFromFile);

            var logger = new FakeLogger();
            return new StringCalculator(settings, logger);
        }
 private StringCalculator StringCalculatorFactory(bool isEnabled = true)
 {
     var logger = new FakeLogger();
     return StringCalculatorFactory(isEnabled, logger);
 }