public async Task StartAsync()
        {
            Console.Clear();
            IDirectoryInfoWrapper directory = _directoryInfoWrapperFactory.Create(_magisterDirectoryLocation);

            IFileInfoWrapper[] files = directory.GetFiles();

            if (files.Any())
            {
                PrintAvailableFiles(files);
                await CreateClassFromFile(files);
            }
            else
            {
                Console.WriteLine("No magister files present. Add a file into the folder:");
                Console.WriteLine(_magisterDirectoryLocation.Value);
                SharedConsoleFlows.AskForAnyKey("Press any key to go back.");
            }
        }
예제 #2
0
        /// <inheritdoc/>
        public async Task StartAsync()
        {
            Console.Clear();
            Cifra.Application.Models.Class.Class chosenClass = await AskForClassAsync();

            Cifra.Application.Models.Test.Test chosenTest = await AskForTestAsync();

            Console.Clear();
            string fileName = SharedConsoleFlows.AskForString("What should be the name of the spreadsheet?");

            SaveResult saveResult = await BuildSpreadsheetAsync(chosenClass, chosenTest, fileName);

            if (saveResult.IsSuccess)
            {
                Console.WriteLine("File successfully saved.");
                SharedConsoleFlows.AskForAnyKey("Press any key to go back");
            }
            else
            {
                Console.WriteLine("File not saved due to an error.");
                SharedConsoleFlows.AskForAnyKey("Press any key to go back");
            }
        }