public static void CreateTestsCsProj(string solutionDirectory, string projectBaseName, bool addJwtAuth) { try { var classPath = ClassPathHelper.FunctionalTestProjectClassPath(solutionDirectory, projectBaseName); if (!Directory.Exists(classPath.ClassDirectory)) { Directory.CreateDirectory(classPath.ClassDirectory); } if (File.Exists(classPath.FullClassPath)) { throw new FileAlreadyExistsException(classPath.FullClassPath); } using (FileStream fs = File.Create(classPath.FullClassPath)) { var data = ""; data = GetTestsCsProjFileText(addJwtAuth, solutionDirectory, projectBaseName); fs.Write(Encoding.UTF8.GetBytes(data)); } } catch (FileAlreadyExistsException e) { WriteError(e.Message); throw; } catch (Exception e) { WriteError($"An unhandled exception occurred when running the API command.\nThe error details are: \n{e.Message}"); throw; } }
public static void CreateTestsCsProj(string solutionDirectory, string projectBaseName, bool addJwtAuth) { var classPath = ClassPathHelper.FunctionalTestProjectClassPath(solutionDirectory, projectBaseName); if (!Directory.Exists(classPath.ClassDirectory)) { Directory.CreateDirectory(classPath.ClassDirectory); } if (File.Exists(classPath.FullClassPath)) { throw new FileAlreadyExistsException(classPath.FullClassPath); } using (FileStream fs = File.Create(classPath.FullClassPath)) { var data = ""; data = GetTestsCsProjFileText(addJwtAuth, solutionDirectory, projectBaseName); fs.Write(Encoding.UTF8.GetBytes(data)); } }