Skip to content

Commit 66faf2c

Browse files
committed
Fixes broken unit test
1 parent 67f7f29 commit 66faf2c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/GitVersionExe.Tests/ArgumentParserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public void CreateMulitpleAssemblyInfoProtected(string command)
320320
exception.Message.ShouldBe("Can't specify multiple assembly info files when using /ensureassemblyinfo switch, either use a single assembly info file or do not specify /ensureassemblyinfo and create assembly info files manually");
321321
}
322322

323-
[TestCase("-updateProjectFiles Assembly.csproj Assembly1.csproj -ensureassemblyinfo")]
323+
[TestCase("-updateProjectFiles Assembly.csproj -ensureassemblyinfo")]
324324
public void UpdateProjectInfoWithEnsureAssemblyInfoProtected(string command)
325325
{
326326
var exception = Assert.Throws<WarningException>(() => argumentParser.ParseArguments(command));

src/GitVersionExe/ArgumentParser.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ private static void ParseEnsureAssemblyInfo(Arguments arguments, string value)
424424
arguments.EnsureAssemblyInfo = false;
425425
}
426426

427+
if (arguments.UpdateProjectFiles)
428+
{
429+
throw new WarningException("Cannot specify -ensureassemblyinfo with updateprojectfiles: please ensure your project file exists before attempting to update it");
430+
}
431+
427432
if (arguments.UpdateAssemblyInfoFileName.Count > 1 && arguments.EnsureAssemblyInfo)
428433
{
429434
throw new WarningException("Can't specify multiple assembly info files when using /ensureassemblyinfo switch, either use a single assembly info file or do not specify /ensureassemblyinfo and create assembly info files manually");

0 commit comments

Comments
 (0)