From c6de6fcc72957cfeca2bf67d272f93f6eeb9221f Mon Sep 17 00:00:00 2001 From: Isaac Llopis Date: Mon, 29 Jun 2020 07:41:14 +0100 Subject: [PATCH] Make name optional in DotnetNewAsync --- Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs b/Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs index ad6753aa..161c0150 100644 --- a/Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs +++ b/Source/Boxed.DotnetNewTest/TempDirectoryExtensions.cs @@ -25,7 +25,7 @@ public static class TempDirectoryExtensions public static async Task DotnetNewAsync( this TempDirectory tempDirectory, string templateName, - string name, + string name = null, IDictionary arguments = null, TimeSpan? timeout = null, bool showShellWindow = false) @@ -35,7 +35,13 @@ public static async Task DotnetNewAsync( throw new ArgumentNullException(nameof(tempDirectory)); } - var stringBuilder = new StringBuilder($"new {templateName} --name \"{name}\""); + var stringBuilder = new StringBuilder($"new {templateName}"); + + if (name != null) + { + stringBuilder.Append($" --name \"{name}\""); + } + if (arguments is object) { foreach (var argument in arguments)