private static void PrintTest(WriteSpecFlowTest specflowTest) { Console.WriteLine("Do you wish to see the test?"); if (Console.ReadLine().ToUpper().StartsWith("Y")) { Console.Write(specflowTest.SpecFlowTest); } }
private static void Save(WriteSpecFlowTest specflowTest) { Console.WriteLine("Please enter the save location"); var savePath = Path.GetFullPath(Console.ReadLine()); while (!Directory.Exists(savePath)) { Console.WriteLine($"Directory {savePath} doesn't exist. Please create it and press any key when done"); savePath = Console.ReadLine(); } specflowTest.SaveToFile(savePath); }
static void Main(string[] args) { AskForCollectionDetails(out string collectionName, out string filePath); WriteSpecFlowTest specflowTest = WriteSpecFlowTest.New() .ForCollection(collectionName) .UsingFile(filePath) .CreateTestGivenStatements() .CreateTestWhenStatement() .CreateThenStatements(); PrintTest(specflowTest); if (!PromptToSave()) { return; } Save(specflowTest); return; }