예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
        }