-
Notifications
You must be signed in to change notification settings - Fork 651
Adding support to generate WiX version files #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support to generate WiX version files #1386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. If it's possible to test this in any way, I would appreciate a few tests. 😄
You are welcome. I have added some testcases that cover the use cases scenarios for this patch |
@@ -0,0 +1,102 @@ | |||
namespace GitVersionExe.Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only GitVersionExe
tests and not for GitVersionCore
? Also, don't you agree approval tests such as this is better suited for file manipulation testing such as this?
GitVersion/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs
Lines 26 to 40 in ee5b77a
public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) | |
{ | |
var fileSystem = new TestFileSystem(); | |
var workingDir = Path.GetTempPath(); | |
var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; | |
var fullPath = Path.Combine(workingDir, assemblyInfoFile); | |
var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); | |
using (var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(assemblyInfoFile, workingDir, variables, fileSystem, true)) | |
{ | |
assemblyInfoFileUpdater.Update(); | |
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(Path.Combine("Approved", fileExtension))); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain this in detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure. Approval tests allows you to create a file on disk that is what the test is compared against. If the content matches, the test is successful, otherwise it fails and a diff is presented.
The above test will verify the manipulated file content against the following approved text file:
Lines 1 to 13 in ee5b77a
//------------------------------------------------------------------------------ | |
// <auto-generated> | |
// This code was generated by GitVersion. | |
// | |
// You can modify this code as we will not overwrite it when re-executing GitVersion | |
// </auto-generated> | |
//------------------------------------------------------------------------------ | |
using System.Reflection; | |
[assembly: AssemblyFileVersion("1.0.0.0")] | |
[assembly: AssemblyVersion("1.0.0.0")] | |
[assembly: AssemblyInformationalVersion("1.0.0")] |
@ruhullahshah, can you please find time to address the code review comment regarding approval testing, rebase and resolve the conflicts of this PR? |
I will resolve the pending work in #1599, |
GitVersion.exe /updatewixversionfile
GitVersion_WixVersion.zip