Esempio n. 1
0
        // Equivalent to Main in Program.cs
        public void Run()
        {
            //Adds global exception handling
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper;

            string inputStyle;

            do
            {
                Console.Write("Choose your input (\"Manual\" or \"File\"): ");
                inputStyle = Console.ReadLine();
            } while (inputStyle != null && inputStyle.ToLower() != "manual" && inputStyle.ToLower() != "file");

            var inputStrategy = _inputFactory.GetInputStrategy(inputStyle);

            var allTalks = inputStrategy.Read();

            var builder    = new ConferenceBuilder(allTalks, _trackService, _sessions);
            var conference = builder.BuildConference();

            Console.WriteLine(conference.Print());
        }
        public void WhenFileInputTypeIsGiven_ReturnsCorrectObject()
        {
            var result = _inputFactory.GetInputStrategy("file");

            result.ShouldBeOfType <FileInput>();
        }