Skip to content

Adding support to generate WiX version files#1386

Closed
ruhullahshah wants to merge 7 commits into
GitTools:masterfrom
ruhullahshah:feature/add_support_for_emitting_vars_in_wix_format
Closed

Adding support to generate WiX version files#1386
ruhullahshah wants to merge 7 commits into
GitTools:masterfrom
ruhullahshah:feature/add_support_for_emitting_vars_in_wix_format

Conversation

@ruhullahshah

Copy link
Copy Markdown
Contributor

@ruhullahshah ruhullahshah changed the title Adding support to generate Wix version files Adding support to generate WiX version files Mar 15, 2018

@asbjornu asbjornu left a comment

Copy link
Copy Markdown
Member

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. 😄

@ruhullahshah

Copy link
Copy Markdown
Contributor Author

You are welcome. I have added some testcases that cover the use cases scenarios for this patch

@@ -0,0 +1,102 @@
namespace GitVersionExe.Tests

Copy link
Copy Markdown
Member

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?

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)));
}
}

Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Member

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:

//------------------------------------------------------------------------------
// <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")]

Comment thread src/GitVersionExe/HelpWriter.cs
@asbjornu

Copy link
Copy Markdown
Member

@ruhullahshah, can you please find time to address the code review comment regarding approval testing, rebase and resolve the conflicts of this PR?

@ruhullahshah

Copy link
Copy Markdown
Contributor Author

I will resolve the pending work in #1599,

@ruhullahshah ruhullahshah deleted the feature/add_support_for_emitting_vars_in_wix_format branch February 20, 2019 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants